coppermine-gallery.com/forum

Support => cpg1.3.x Support => Older/other versions => cpg1.3 Ecards & Email => Topic started by: natrlhy on July 24, 2004, 02:36:10 AM

Title: [Solved]: ecard timezone way off
Post by: natrlhy on July 24, 2004, 02:36:10 AM
When I send an ecard, it says I sent an ecard on "Saturday, July,30,2004 12:31 AM [GMT]" when i really sent it today, July 23, 2004 5:31 PM [PDT]

Is there a way to change this to be accurate?

Thanks!
Title: Re: ecard timezone way off
Post by: kegobeer on July 24, 2004, 07:36:32 AM
The next version will include the ability to set the local timezone.  You can hard code it, but I'd just wait.  And technically, the time is accurate.  GMT-7 = PDT.   ;)
Title: Re: ecard timezone way off
Post by: natrlhy on July 24, 2004, 10:47:18 AM
Can't wait for the next release ;)

But GMT-7? That's minus 7 hours, not days too is it? I sent it on the 23rd (5:31PM PST), the ecard said the 30th (12:31AM GMT)  ???  :)
Title: Re: ecard timezone way off
Post by: Joachim Müller on July 24, 2004, 01:01:25 PM
check your server clock.

GauGau
Title: Re: ecard timezone way off
Post by: natrlhy on July 24, 2004, 11:23:51 PM
Server is set correctly...
Title: Re: ecard timezone way off
Post by: Joachim Müller on July 25, 2004, 08:21:31 PM
I have no clue why this happens then, sorry. Anyone else?

GauGau
Title: Re: ecard timezone way off
Post by: kegobeer on July 25, 2004, 08:25:50 PM
Post a link to your site - I'd like to send an ecard and see what time shows up.  Please create a normal user account and post the login/pass here.

Also, are you sending email via php or smtp?  The mail server's time could be off.
Title: Re: ecard timezone way off
Post by: natrlhy on July 27, 2004, 07:05:12 PM
I modified the mailer.inc.php file to point to the server I wanted mail routed through. The server time on that mail server is correct.
Please let me know when I can delete the account.
Thanks for looking into this!
Title: Re: ecard timezone way off
Post by: Nibbler on July 27, 2004, 11:44:56 PM
I can see what is wrong - the date stamp is using %V, which is the week number of the year eg 1 to 53. Change it to %d.


[fixed in stable (ecard.php v1.9), devel will use GMT offset so not affected by this]
Title: Re: ecard timezone way off
Post by: natrlhy on July 28, 2004, 01:23:17 AM
Thats much better!

Sent by natrlhy from IP x.x.x.x at Tuesday, July,27,2004 11:17 PM [GMT]

Now just awaiting the next release to change the timezone.
Thanks! I have delete the test account.

For reference, I modified this line in the ecard.php file:

$message .= "Sent by $sender_name from IP {$_SERVER['REMOTE_ADDR']} at ".gmstrftime("%A,  %B,%d,%Y %I:%M %p ", time())." [GMT]";
                                                                                                                                                    |
                                                                                                                                                    this was %V