| View previous topic :: View next topic |
| Author |
Message |
Coldbird

Joined: 08 Feb 2007 Posts: 155
|
Posted: Thu Apr 15, 2010 4:29 am Post subject: Query and Format Time |
|
|
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 |
|
 |
sauron_le_noir
Joined: 05 Jul 2008 Posts: 229
|
Posted: Thu Apr 15, 2010 5:07 am Post subject: |
|
|
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 |
|
 |
jimparis
Joined: 10 Jun 2005 Posts: 1179 Location: Boston
|
|
| Back to top |
|
 |
|