This article is from a FAQ concerning SCO operating systems. While some of the information may be applicable to any OS, or any Unix or Linux OS, it may be specific to SCO Xenix, Open Desktop or Openserver.

There is lots of Linux, Mac OS X and general Unix info elsewhere on this site: Search this site is the best way to find anything.

Unix, Xenix and ODT General FAQ

How can I find tomorrow's or yesterday's date in a script?

datemath.tgz is available from ftp://ftp.jpr.com , that gives you the ability to do (for example):


Hate these ads?



 datecalc + 1


 



and get tomorrow's date. There are shell and awk scripts for various date related tasks.

If running Linux, "date --date=tomorrow" is a simple way to do it. On Mac OS X, you could do:

x=`date +%s`
date -r `expr $x + 86400`

It's all a lot easier with Perl. See http://aplawrence.com/Bofcusm/1455.html and http://aplawrence.com/Unix/yesterday.html also.








Comments /SCOFAQ/FAQ_scotec6datemath.html


Tue Mar 21 08:23:48 2006: Subject:   anonymous
I see only script for yesterday date.


Why no one post about how to find tomorrow date?

Tue Mar 21 14:35:45 2006: Subject:   BigDumbDinosaur
I see only script for yesterday date. Why no one post about how to find tomorrow date?

Try carefully reading the entire page, bucko. The answer is right there in front of you. Geesh!



Add your comments

cartoon
Forget the expense of flying to New England. Forget hotel and meals costs.
Installation and light training Boston and New England


Enter your email address for automatic notification of new posts here
(be sure to whitelist 'feedburner.com' if you use spam filtering)

Or use any RSS reader

Delivered by FeedBurner


ad

Views for this page
Today This Week This Month This Year  Overall
112292,588 9,025

/SCOFAQ/FAQ_scotec6datemath.html copyright 1997-2003 (various) All Rights Reserved

Have you tried Searching this site?

Unix/Linux/Mac OS X support by phone, email or on-site: Support Rates

This is a Unix/Linux resource website. It contains technical articles about Unix, Linux and general computing related subjects, opinion, news, help files, how-to's, tutorials and more. We appreciate comments and article submissions.

Publishing your articles here

More:
       - FAQ




Unix/Linux Consultants

Your ad here - $24.00 yearly!

http://bcstechnology.net Full service Linux & UNIX systems integrator; Windows to UNIX/Linux Client-Server Specialist; Secure E-Mail & Website Hosting; Thoroughbred Software Developer; Custom Industrial Automation; Hardware & Electronics Experts; In Business Since 1985.


http://www.breakthru.com.au SCO (Openserver and Unixware), Unix, Solaris and Linux Consulting services including: Secure Networking Solutions; Linux based Firewalls; Backup Solutions; Secure Home to Office Network Setup; Phone, Remote and On-Site Support available - Satisfaction Guaranteed!


larryi@ccamedical.com SCO OS5, Debian Linux, RedHat Linux, MySQL, Apache, AJAX development using dXport/dL4/Unibasic, Windows Connectivity, Sharing Resouces, Automation, Shell Scripting









Change Congress

Related Posts