Re: about timestamp reformat

From: Gunnar Hjalmarsson (noreply_at_gunnar.cc)
Date: 03/26/04


Date: Fri, 26 Mar 2004 20:38:53 GMT

janet wrote:
> Gunnar Hjalmarsson wrote:
>> Gunnar Hjalmarsson wrote:
>>>
>>> { '|' . (sprintf '%d-%02d-%02d-%02d%s%06d', $3, $months{$1},
>>> $2, $7 eq 'PM' ? 12+$4 : $4, $5, $6) . '|' }egx;
>>
>> Those lines are probably better replaced with:
>>
>> { '|' . (sprintf '%d-%02d-%02d-%02d%s%03d', $3, $months{$1},
>> $2, $7 eq 'PM' ? 12+$4 : $4, $5, $6) . '000|' }egx;
>
> I met a new problem when convert the data
>
> For exp:
>
> 12:35:40, if converted, it would change to 24:45:40. that is not
> correct. I'm not very familiar with Perl,

I know, you told us so in your original post. (I'm not very familiar
with the AM/PM time format.)

Since you asked for help here, I thought you were about to learn Perl,
so I hoped you would figure out how the the code I posted works, and
learn something new by doing so. Now I understand that that was never
your intention. Apparently you just wanted somebody to do your job for
you.

> who could help me how to do it?

I won't.

> Gunnar, do you have time to take a look ?

I'm not in the mood.

-- 
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl


Relevant Pages

  • Re: Docs comprehensibility
    ... who started his programming 'career' a few years ago by modifying Matt ... to fix the Perl documentation. ... >> feel confident enough. ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: redirect without meta
    ... Tad McClellan wrote: ... it was a CGI problem rather than a Perl ... system interaction, emails, database communication etc. ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: redirect without meta
    ... >> program written in Perl. ... >> system interaction, emails, database communication etc. politely ... There was nothing wrong with your response; ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: clpannounce problem
    ... Your posting for comp.lang.perl.announce has been received and queued. ... moderated group for announcements of new releases of perl ... Please do not include the *entire* documentation of your item. ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)
  • Re: Why does Perl use more resource than Php?
    ... A Perl app that means a large number ... >> require less CPU for a similar app, so the language may well be ... Gunnar Hjalmarsson ...
    (comp.lang.perl.misc)