UPDATE: Unix Time

From: MARCELO ALONSO MONDRAGON (malonsom_at_villacero.com.mx)
Date: 05/26/03

  • Next message: Harihar Krishnan: ""Advanced Server for Unix" query..."
    Date: Mon, 26 May 2003 08:40:31 -0600
    To: tru64-unix-managers@ornl.gov
    
    

    Thank you for their answers, but How could I make the inverse process?,
    convert whatever date in human format to unix format.

    In order to get the date in unix format, their answers were:

    From: William H. Magill <magill@mcgillsociety.org>

    #!/usr/bin/perl
    #
    print scalar(localtime($ARGV[0]));
    print "\n";

    From: Michael James Bradford <mjbr@tdc.dk>

    #!/bin/perl
    $now=localtime(<stdin>);
    print $now,"\n"
    If you call the script convert_time.pl, then you run it as follows:
    $ echo "1049972098"|convert_time.pl
    Thu Apr 10 12:54:58 2003

    From: Martin Adolfsson <mad@netilium.org>

    perl -e 'print time()."\n"'

    And other answers more

    Marcelo Alonso Mondragón
    Soporte Técnico / Informática / SICARTSA
    Una Empresa del Grupo Villacero
    E-Mail: malonsom@villacero.com.mx
    Internet: http://www.villacero.com.mx


  • Next message: Harihar Krishnan: ""Advanced Server for Unix" query..."

    Relevant Pages

    • Re: date parts in one step
      ... # get values in Unix format ... # convert to human format ... Hmm, looks good but I want to use it in script not from commandline. ...
      (comp.lang.perl.misc)
    • Re: date parts in one step
      ... # get values in Unix format ... # convert to human format ... separate calls to localtime. ...
      (comp.lang.perl.misc)
    • Re: date parts in one step
      ... # get values in Unix format ... # convert to human format ... $ perl -wle' ... Hmm, looks good but I want to use it in script not from commandline. ...
      (comp.lang.perl.misc)
    • Re: date parts in one step
      ... Petr Vileta wrote: ... # get values in Unix format ... # convert to human format ... can special-order certain sorts of tools at low cost and ...
      (comp.lang.perl.misc)
    • date parts in one step
      ... I need to get month and year values from localtime() so I wrote this: ... # get values in Unix format ... # convert to human format ... Send me your mail from another non-spammer site please.) ...
      (comp.lang.perl.misc)