CodeCharge Studio
search Register Login  

Web Reporting

Visually create Web Reports in PHP, ASP, .NET, Java, Perl and ColdFusion.
CodeCharge.com

YesSoftware Forums -> CodeCharge Studio -> PHP

 CurrentDateTime

Print topic Send  topic

Author Message
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.
View profile  Send private message
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.
View profile  Send private message
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.
View profile  Send private message
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.
View profile  Send private message

Add new topic Subscribe to topic   


These are Community Forums for users to exchange information.
If you would like to obtain technical product help please visit http://support.yessoftware.com.

MS Access to Web

Convert MS Access to Web.
Join thousands of Web developers who build Web applications with minimal coding.

CodeCharge.com

Home   |    Search   |    Members   |    Register   |    Login


Powered by UltraApps Forum created with CodeCharge Studio
Copyright © 2003-2004 by UltraApps.com  and YesSoftware, Inc.