forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get actual time in PSP?

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
kweensey



Joined: 29 Jan 2009
Posts: 26

PostPosted: Sat Feb 28, 2009 3:38 am    Post subject: How to get actual time in PSP? Reply with quote

Hey,
Is there any way to get time (in hours and minutes) adjusted in PSP?

Thank you.
kweensey


Last edited by kweensey on Sat Feb 28, 2009 7:54 pm; edited 1 time in total
Back to top
View user's profile Send private message
Zer01ne



Joined: 08 Sep 2008
Posts: 29

PostPosted: Sat Feb 28, 2009 9:57 am    Post subject: Reply with quote

pspTime psptime;
sceRtcGetCurrentClockLocalTime(&psptime);

printf("%02u/%02u/%02u %02u:%02u:%02u", psptime. day, psptime.month, psptime.year, psptime.hour, psptime.minutes, psptime.seconds);
Back to top
View user's profile Send private message
kweensey



Joined: 29 Jan 2009
Posts: 26

PostPosted: Sat Feb 28, 2009 7:46 pm    Post subject: Reply with quote

Hey,
thanks for reply.. :)

Do I need to define something? Because if I compile that, Cygwin give me some errors:

Code:
psp-gcc -I. -I/usr/local/pspdev/psp/sdk/include -O2 -G0 -Wall -D_PSP_FW_VERSION=
150   -c -o main.o main.c
main.c: In function 'main':
main.c:43: error: 'pspTime' undeclared (first use in this function)
main.c:43: error: (Each undeclared identifier is reported only once
main.c:43: error: for each function it appears in.)
main.c:43: error: expected ';' before 'psptime'
main.c:45: warning: implicit declaration of function 'sceRtcGetCurrentClockLocal
Time'
main.c:45: error: 'psptime' undeclared (first use in this function)
make: *** [main.o] Error 1


Thanks for help.
kweensey
Back to top
View user's profile Send private message
Zer01ne



Joined: 08 Sep 2008
Posts: 29

PostPosted: Sat Feb 28, 2009 10:46 pm    Post subject: Reply with quote

#include <psprtc.h>
Back to top
View user's profile Send private message
kweensey



Joined: 29 Jan 2009
Posts: 26

PostPosted: Sat Feb 28, 2009 10:49 pm    Post subject: Reply with quote

Everything OK now.. Thank you.. ;)

kweensey
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group