Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^3: Using Time::Piece Strptime

by poj (Abbot)
on Jan 26, 2016 at 17:29 UTC ( [id://1153693]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Using Time::Piece Strptime
in thread Using Time::Piece Strptime

Date formats in excel can be tricky. See Excel::Writer::XLSX::Utility

#!perl use strict; use Excel::Writer::XLSX; use Excel::Writer::XLSX::Utility; use Time::Piece; my $wb = Excel::Writer::XLSX->new( 'dates.xlsx' ); my $ws = $wb->add_worksheet(); my $fmt = $wb->add_format(); $fmt->set_num_format( 'dddd mmm dd, yyyy' ); my $date = '3/15/16, 00, Mar, 2016'; my $t = Time::Piece->strptime($date, '%D, %M, %b, %Y') ; my $xldate = xl_date_list($t->year, $t->mon, $t->mday); $ws->write( 0, 0, $xldate, $fmt ); $wb->close();
poj

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1153693]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (2)
As of 2024-04-25 05:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found