Solved

Dates

Posted on 1999-01-24
3
217 Views
Last Modified: 2010-04-21
How do you find a date in time?
example: day of the week for april 11, 1982
0
Comment
Question by:Rossman
  • 2
3 Comments
 
LVL 2

Accepted Solution

by:
bertvermeerbergen earned 50 total points
ID: 2009404
Supposing you are using C, check out the man pages for mktime() and gmtime() or localtime().  This first lets you initialize a structure with a given date, while the other two use this structure to calculate the day of week, among other things.
If you need a shell script solution, this could be a lot harder to do unless you call a small C program that does the conversion for you.
0
 
LVL 84

Expert Comment

by:ozo
ID: 2009405
cal 4 1982
0
 
LVL 84

Expert Comment

by:ozo
ID: 2009406
perl -MDate::Manip -e 'print UnixDate(ParseDate(\@ARGV),"%A")' april 11, 1982
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Attention: This article will no longer be maintained. If you have any questions, please feel free to mail me. jgh@FreeBSD.org Please see http://www.freebsd.org/doc/en_US.ISO8859-1/articles/freebsd-update-server/ for the updated article. It is avail…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now