How to translate date in dd/mm/yy format

How to translate date in dd/mm/yy format

Post by calvi » Fri, 17 Apr 1998 04:00:00



Hi all

I have a log file that has entries as the following:

25/5/98   xxx   yyy
26/5/98   xxx   yyy

Is there a way to translate 25/5/98 into the actual day? for example,
Saturday.

Appreciate your help via email too. Thank you/


 
 
 

How to translate date in dd/mm/yy format

Post by Charles Dem » Fri, 17 Apr 1998 04:00:00




>Hi all

>I have a log file that has entries as the following:

>25/5/98   xxx   yyy
>26/5/98   xxx   yyy

>Is there a way to translate 25/5/98 into the actual day? for example,
>Saturday.

Calculate the number of days from a given day, do a modulo 7 on that
to get a number in the range of 0-6 and use that as an index into an
array of predefined day name strings.

I'll let you work out the pesky details.  :-)

You could also use the cal command, and then mess with the output.

You could create a file with dates in that format and days and
just look it up.

Perhaps other methods exist.

Chuck Demas
Needham, Mass.

--
  Eat Healthy    |   _ _   | Nothing would be done at all,

  Die Anyway     |    v    | That no one could find fault with it.


 
 
 

How to translate date in dd/mm/yy format

Post by Jon LaBad » Sat, 18 Apr 1998 04:00:00



|> >Hi all
|> >
|> >I have a log file that has entries as the following:
|> >
|> >25/5/98   xxx   yyy
|> >26/5/98   xxx   yyy
|> >
|> >
|> >Is there a way to translate 25/5/98 into the actual day? for example,
|> >Saturday.
|>
    ...
|>
|> I'll let you work out the pesky details.  :-)
|>
    ...
|> Perhaps other methods exist.

The getdate program will only take that form of date as mo/da/yr,
but if you can rearrange it you could use it with your TimeZone
and the ctime command as follows:

   $ ctime `getdate "5/25/98 EST"`
   Mon May 25 01:00:00 1998

BTW it is a Monday, not Saturday.

jl
--


 4455 Province Line Road        (609) 252-0159
 Princeton, NJ  08540-4322      (609) 683-7220 (fax)

 
 
 

1. Changing all date fields from mm/dd/yy to dd/mm/yy

Please, I'm looking for a way to change all date fields in a specified
file, like this:

solaris> cat file

05/23/06      03/12/06

07/10/06                   11/12/06           09/20/06

      03/11/06

I need change all date field from mm/dd/yy to dd/mm/yy, like this:

solaris> ./script < cat file

23/05/06        12/03/06

10/07/06                 12/11/06             20/09/06

       11/03/06

Thanks !

2. gopher proxy in apache 1.1.3 server

3. Sort by First Date Field (MM/DD/YY)

4. Problems with PnP Modem, linux cannot detect Port

5. How to convert Posix date to YY/MM/DD ?

6. Net problems... PLS. help

7. How to read file modification date (mm-dd-yy) in Korn

8. Patch madness for Solaris 7

9. HELP: C prog to get mm/dd/yy format

10. Files modified since yy/mm/dd hh:mm

11. How to convert Unix date to DD/MM/YYYY HH:MM:SS

12. how to convert given no. into unix dd:mm:yyyy -hh:mm:ss format

13. sort MM/DD/YY in reverse chron order with -k...