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 

Query and Format Time

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



Joined: 08 Feb 2007
Posts: 155

PostPosted: Thu Apr 15, 2010 4:29 am    Post subject: Query and Format Time Reply with quote

I need to query the current time on my PSP and format them into a string.

Someone has a idea how to do that?
_________________
Been gone for some time. Now I'm back. Someone mind getting me up-2-date?
Back to top
View user's profile Send private message MSN Messenger
sauron_le_noir



Joined: 05 Jul 2008
Posts: 229

PostPosted: Thu Apr 15, 2010 5:07 am    Post subject: Reply with quote

See in psprtc.h in the sdk

int sceRtcGetCurrentClockLocalTime(pspTime *time);

where pspTime is a structure like this

typedef struct {
u16 year;
u16 month;
u16 day;
u16 hour;
u16 minutes;
u16 seconds;
u32 microseconds;
} pspTime;

after this you use sprintf like usual ;)

printf("%04d %02d %02d",time.year,time.month,time.day);

or you can use the libc time function


Last edited by sauron_le_noir on Thu Apr 15, 2010 5:13 am; edited 2 times in total
Back to top
View user's profile Send private message Send e-mail MSN Messenger
jimparis



Joined: 10 Jun 2005
Posts: 1179
Location: Boston

PostPosted: Thu Apr 15, 2010 5:08 am    Post subject: Reply with quote

http://linux.die.net/man/3/strftime
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