Re: POSIX 'strftime' and time zones

2003-10-01 Thread fliptop
On Tue, 30 Sep 2003 at 23:57, David Gilden opined:

DG:How can I add two hours to offset for central time?

try date::calc

http://search.cpan.org/~stbey/Date-Calc-5.3/

you'll probably want to use the Add_Delta_Days() function.


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



RE: POSIX 'strftime' and time zones

2003-10-01 Thread Wiggins d'Anconia


On Tue, 30 Sep 2003 23:57:16 -0500, David Gilden [EMAIL PROTECTED] wrote:

 Quick question,
 
 the server is on west coast time (California)
 client is in Texas, central time (+2 hours)
 
 How can I add two hours to offset for central time?
 Thx,
 Dave
 
 
 #!/usr/local/bin/perl 
 use POSIX 'strftime';
 my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime);
 print $date;
 

As fliptop said modules are groovy for this kind of thing, but if your needs aren't to 
great, you can use the old standby of adding the number of seconds in 2 hours to the 
time provided by 'time' which is the default to 'localtime'...

localtime( time() + (2*60*60) )

Of course for those of us in the back asswards state of Indiana or I suppose the rest 
of the world, this only works half the time when talking to someone that is in the 
other sets which is why a robust module is usually better at this kind of thing.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



POSIX 'strftime' and time zones

2003-09-30 Thread David Gilden
Quick question,

the server is on west coast time (California)
client is in Texas, central time (+2 hours)

How can I add two hours to offset for central time?
Thx,
Dave


#!/usr/local/bin/perl 
use POSIX 'strftime';
my $date = strftime('%A, %B %d, %Y %I:%M %p',localtime);
print $date;

--

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]