in reply to How to set a processes notion of the timezone on win32?
In order to just get the current date/time in UTC format, you can use:my $oldDate = DateTime->new(month=>$monthVar, day=>$dayVar, year=>$yearVar, hour=>$hourVar, minute=>$minuteVar, time_zone=>'local'); $dateObject = $oldDate->clone()->set_time_zone('UTC'); $dateObject =~ s/T/ /; print &UnixDate($dateObject,"%m/%d/%Y %H:%M")
$dateObject = DateTime->now(time_zone=>'UTC'); print $dateObject;
|
|---|