in reply to Re^12: Sybase BCP date formatter
in thread Sybase BCP date formatter

I'm sure there is. What have you tried so far?

Replies are listed 'Best First'.
Re^14: Sybase BCP date formatter
by LangeNet (Initiate) on Dec 17, 2008 at 15:07 UTC
    I'm sure the change is made somewhere in the following part. I've tried this
    s/(^|\,)($mon_re)\s{1,2}(\d{1,2})\s(\d{4})\s\s?(\d\d?):(\d\d):(\ +d\d):(\d{3})([AP])M(\,|$)/ $1 . sprintf( '%04d %02d %02d %02d:%02d%03d',
    I can't figure out where the variable for (A/P)M get get loaded. In my mod the output shows the date as: ,1997 01 28 09:53022, I'm looking for ,1 28 1997 09:53AM,

      Read perlre and perlop about s/// and the /e switch. This will give you the information you need to find out where the variables $1 to $9 get loaded. Also, you might be interested in the strftime function of the POSIX module, which has convenient functions to create date/time strings. Even moreso, I recommend staying with the given format YYYY-mm-dd HH:MM:SS instead of using something else.