[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] changing the time returned by localtime



On Mon, Jan 17, 2000 at 07:09:16AM +1030, jakal wrote:
} Is there a simple way of changing the time returned by localtime; 
} 
} I am currently using $time = localtime(time); to get the time, which is 
} then output using print "$time"; and gives me something like "Mon Jan 
} 17 06:44:52 2000". 
} 
} which is the correct time according to the Australian server that it is 
} running on. The problem however is that almost all the users of the CGI 
} which generates the time will be in Europe, and it would make more 
} sense for the time to be about 10 hours ahead (or behind, I can't 
} remeber at the moment). Is there any easy one to do this? 

Sure.  Read the documentation.  Use localtime in list context, and you can
do what you will with the pieces it returns.

For what you're doing, you might want to use gmtime anyway.

} 
} Thanks, 
} 
} Jake 
} 

-- 
Paul Schinder
schinder@pobox.com

# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org