Web Developer's Virtual Library: Encyclopedia of Web Design Tutorials, Articles and Discussions


WDVL Newsletter

Active Server Pages
JSP/Java Servlets
Microsoft SQL Server
Daily Backup
Dedicated Servers
Streaming Audio/Video
24-hour Support    

jobs.webdeveloper.com

Hiermenus


e-commerce
Partner With Us















Developer Channel
FlashKit.com
JavaScript.com
JavaScriptSource
Developer Jobs
ScriptSearch
StreamingMediaWorld
Web Developer's Journal
Web Developer's Virtual Library
WebDeveloper.com
Webreference
Web Hosts
XMLfiles.com

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers


Time and Date

July 19, 1998

Another set of useful tools are those that help you keep track of the time and date. There are two primary utilities that you will use for this purpose: date and cal.

The "date" utility simply displays the current time and date (according to the computer...recall that since you can login to a UNIX machine remotely, the date utility may not give you your local time if you are not in the same time zone as the computer you are logged in to). The "date" utility comes with several options that allow you to format the date displayed.

Options Description
MMDDhhmmYY This option may only be used by the superuser and gives you the ability to set the date. MM is the month (01-12). DD is the day (01-31). hh is the hour (00-23). mm is the minute (00-59) and YY is the year (00-99)
+%format This option specifies how the date is displayed. The valid formats include
a = weekday (represented as a name)
d = day of month (represented as a digit)
D = mm/dd/yy
h = month (represented as a name)
J = julian date
m = month (represented as a digit)
M = minute
n = newline
r = am/pm
S = second
t = tab
W = Day of week(represented as a digit)
y = last two digits in year

Check out the date utility in action.

[Date]

The second time telling utility is the "Cal" utility that displays a calendar through standard output. The "cal" utility is fairly simple and takes only a month and a year as arguments. If no arguments are specified, it assumes the current month and year. If no month is specified, the utility will display all the months for the given year.

Check out the following examples.

[Date]

[Year with Cal]

The "paste" Utility
Introduction to UNIX for Web Developers | Table of Contents
Managing Processes


Up to => Home / Internet / UNIX / Intro




Jupiter Online Media: internet.comearthweb.comDevx.commediabistro.comGraphics.com

Search:

Jupitermedia Corporation has two divisions: Jupiterimages and Jupiter Online Media

Jupitermedia Corporate Info


Legal Notices, Licensing, & Permissions, Privacy Policy.

Web Hosting | Newsletters | Tech Jobs | Shopping | E-mail Offers