I’m using the DateTime Perl module to get the time in a particular timezone. The result of the time is as follows
2010-09-24T02:18:52
How can I convert this to HTTP format before printing?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
CPAN has what you need: DateTime::Format::HTTP.
Description:
Synopsis:
Update
You can pass in the timezone of your source data, use DateTime set_time_zone() to change the timezone, and then use
strftime to generate the string in ‘HTTP’ format. For example:
(line numbers deleted for clarity.)