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 

os.date

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



Joined: 06 Sep 2005
Posts: 36

PostPosted: Mon Sep 12, 2005 7:06 am    Post subject: os.date Reply with quote

When I run os.date("%c") on my psp the time is wrong.
It should give me 14:44 but I get 22:14.

What am I doing wrong? the lua player on windows displays the correct time.
Back to top
View user's profile Send private message
chaos



Joined: 10 Apr 2005
Posts: 135

PostPosted: Mon Sep 12, 2005 1:04 pm    Post subject: Reply with quote

if i had to make a guess, i'd say it was timezone related..
_________________
Chaosmachine Studios: High Quality Homebrew.
Back to top
View user's profile Send private message
MasterQ



Joined: 01 Oct 2005
Posts: 7

PostPosted: Sat Oct 01, 2005 10:25 am    Post subject: Reply with quote

I am having the exact same problem. I think the Lua Player is making an error with timezones. I am on EST (-5) and it randomly gives me either EST, which is what I want, or GMT(0), which is the time before the timezone is taken into account.
Back to top
View user's profile Send private message
2Xtremes2004



Joined: 31 Aug 2005
Posts: 53

PostPosted: Sun Oct 09, 2005 3:20 am    Post subject: Reply with quote

Why does 12:00 = 0:00 and will this be fixed in a future version of Lua?
_________________
I want my money back!?
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Oct 09, 2005 3:40 am    Post subject: Reply with quote

2Xtremes2004 wrote:
Why does 12:00 = 0:00 and will this be fixed in a future version of Lua?


The timezone bug should be fixed in version 0.11.

Do you mean 12:00 pm = 0:00? This is right, see the documentation at http://www.lua.org/manual/5.0/manual.html#5.7 and http://unixhelp.ed.ac.uk/CGI/man-cgi?strftime for a manual, which format strings you can use to use am/pm syntax.
Back to top
View user's profile Send private message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Sun Oct 09, 2005 5:17 am    Post subject: Reply with quote

Ver 0.11 fixed it alright but I think Daylight Saving Time is not applied. My timezone here is GMT-8. PSP itself shows correct time with Daylight Saving.
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
2Xtremes2004



Joined: 31 Aug 2005
Posts: 53

PostPosted: Sun Oct 09, 2005 6:33 am    Post subject: Reply with quote

Yes, 12:00 pm = 0:00 is what I ment, but I now see how it is set up after looking at the two links you provided. Thx

I was able to get the time and date feature formatted the way I like. :)
However I did have one question about it: %p shows the Prefix "AM" and "PM", and %P is supose to show the prefix "am" and "pm", but %P dont show anything.
Is there something else I can use to get it to show "am" and "pm"?
_________________
I want my money back!?
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Sun Oct 09, 2005 6:55 am    Post subject: Reply with quote

2Xtremes2004 wrote:
However I did have one question about it: %p shows the Prefix "AM" and "PM", and %P is supose to show the prefix "am" and "pm", but %P dont show anything.
Is there something else I can use to get it to show "am" and "pm"?


I don't know, perhaps this is a bug in the libc from PSPSDK, but as a workaround you could use string.tolower or you can built your own string, like in http://www.luaplayer.org/gallery/clock.lua.txt with "*t" and using the returned table.
Back to top
View user's profile Send private message
mystic_memories



Joined: 12 Mar 2006
Posts: 12

PostPosted: Sun Mar 12, 2006 8:30 am    Post subject: Reply with quote

Has this bug been re-introduce recently? When I do a os.date("*t"), the hour doesn't seem to take my timezone into consideration. i.e. I get the GMT time rather than the time of my local timezone. I also tried os.date("!*t") as well, they both return the same result.
Back to top
View user's profile Send private message
matriculated



Joined: 04 Mar 2006
Posts: 31

PostPosted: Mon Mar 13, 2006 9:59 am    Post subject: Reply with quote

Same thing over here. The clock program is 12 hours ahead
Back to top
View user's profile Send private message
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Mon Mar 13, 2006 10:04 am    Post subject: Reply with quote

There is still a problem with the timezone, see http://wiki.ps2dev.org/psp:lua_player:todos . Would be nice, if always the time would be used, which you can see in the normal PSP menu, but I don't know how to do it.
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 Lua Player 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