senthil
|
| Posted: 10/09/2004, 9:27 AM |
|
I am using CurrentDateTime in the default value for a create_dt column. It
works well, except that since my users are in different timezones I will
need to make an offset to that date. How can this be accomplished?
|
|
|
 |
Karsten
Posts: 57
|
| Posted: 10/09/2004, 10:31 AM |
|
hi senthil,
am i right, you want to use the time of your server?
if so you should use the date() funktion of php , this allways gives you the time on the server the application is running no matter what timezone the user is in, also you should think about:
how can you be sure the users time is set right?
answer: you cant be sure.
i suggest you to use date() look in www.php.net documentation
the function is very mighty on getting the date and time and formating it in rich various ways.
Karsten from Germany
_________________
If one gives up, he told himself he failed. |
 |
 |
senthil
|
| Posted: 10/09/2004, 5:02 PM |
|
HI Karsten
Yes I want to use the system time as "reference". If I am at a different
time zone and update a record I want the create_datetime field of that
record to reflect the local time of the user. So while the system time is
GMT if I am in Chicago and do an operation at 9.00 pm GMT it should convert
and store the time as 3.00 pm. Should I write a custom function maybe?
Thanks
"Karsten" <Karsten@forum.codecharge> wrote in message
news:54168208f86dfb@news.codecharge.com...
> hi senthil,
>
> am i right, you want to use the time of your server?
>
> if so you should use the date() funktion of php , this allways gives you
> the
> time on the server the application is running no matter what timezone the
> user
> is in, also you should think about:
> how can you be sure the users time is set right?
> answer: you cant be sure.
>
> i suggest you to use date() look in www.php.net documentation
> the function is very mighty on getting the date and time and formating it
> in
> rich various ways.
>
> Karsten from Germany
>
> _________________
> If one gives up, he told himself he failed.
> ---------------------------------------
> Sent from YesSoftware forum
> http://forums.codecharge.com/
>
|
|
|
 |
Karsten
Posts: 57
|
| Posted: 10/09/2004, 6:20 PM |
|
hi senthil
as i told you look the date() funktion, the function can
also deal with a GTM offset (option O) look and read
this function ist so full of features you dont need to write a timecalculation
http://de2.php.net/manual/de/function.date.php
just get the user timezone (save it on registrationprocess ,ask for it in formular for example or get you a country timezonelist and let user select) then on dateoperations just feed the date() function properly
this is what i would do.
Karsten
_________________
If one gives up, he told himself he failed. |
 |
 |
Karsten
Posts: 57
|
| Posted: 10/09/2004, 6:21 PM |
|
sorry here the link to the english version of the date() documentation
http://de2.php.net/manual/en/function.date.php
_________________
If one gives up, he told himself he failed. |
 |
 |
RonB
Posts: 228
|
| Posted: 10/13/2004, 5:56 AM |
|
You could also use a hidden field on your form and use javascript to fill it with the local time for that user.
|
 |
 |
|