08-29-2008
Example
It is a handy date time function. We use it on AIX,Solaris,Windows and even 32bit Red Hat but this 64 bit is prewenting a problem.
K$ dtfn -?
Usage: dtfn [-options] Otto P. Bedrosian V1.20 2006-11-10
Default date format is mm/dd/[yy]yy (US) unless specified otherwise.
If date is not entered, system date is substituted if appropriate.
If 2-digit year is entered it will be expanded to 4-digit using
a rolling window based on system date +10 and -90 years.
Valid range of dates is from 1753 to 2799.
${T1} is date and time in the format 'mm/dd/yyyy hh:mi:ss'.
-A months [mm/dd/yyyy] Adjust the date by the number of months.
-a days [mm/dd/yyyy] Adjust the date by the number of days.
-B [mm/dd/yyyy] Beginning of the week (Sunday) for a date.
-b [mm/dd/yyyy] First workday of the month for a date.
-C [mm/dd/yyyy] Day of century for the date.
-c mm/dd/yyyy [mm/dd/yyyy] Compare date1 and date2. Return (date1 - date2).
-D [mm/dd/yyyy] Name of the day for a date (Monday).
-d [mm/dd/yyyy] Abbreviated name of the day for a date (Mon).
-E [mm/dd/yyyy] End of week (Saturday) for a date.
-e [yyyy] Date of Easter for a year.
-F days [mm/dd/yyyy] Adjust the date by the number of workdays.
-f mm/dd/yyyy [mm/dd/yyyy] Workdays between date1 and date2 (inclusive).
-G minutes [${T1}] Adjust the date/time by minutes ('yyyy-mm-dd hh:mi:ss').
-g minutes [${T1}] Adjust the date/time by minutes ('mm/dd/yyyy hh:mi:ss').
-H [yyyy-mm-dd] Abbreviated name of the day for a date (Mon).
-I [yyyy] Daylight Saving Time spring switchover date for US.
-i [yyyy] Daylight Saving Time fall switchover date for US.
-J JD number Date from Julian Date (2,361,222 - 2,743,738).
-j [mm/dd/yyyy] Julian Date number for the date (1753 - 2799).
-K [mm/dd/yyyy] Number of days in a year 'yyyyddd'.
-k [yy][yy]ddd Date from number of days in a year 'mm/dd/yyyy'.
-L [mm/dd/yyyy] Last day of the month for a date.
-l [mm/dd/yyyy] Last workday of the month for a date.
-M [mm/dd/yyyy] Name of the month for the date (January).
-m [mm/dd/yyyy] Abbreviated name of the month for the date (Jan).
-N [mm/dd/yyyy] Work hours in the month for a date (8 hrs/day).
-n weeks [mm/dd/yyyy] Adjust the date by the number of weeks.
-O [dd-MON-yyyy] Convert date from 'dd-MON-yyyy' to 'mm/dd/yyyy'.
-o [mm/dd/yyyy] Convert date from 'mm/dd/yyyy' to 'dd-MON-yyyy'.
-P hours [mm/dd/yyyy] Adjust the date by work hours (8 hrs/day).
-p mm/dd/yyyy [mm/dd/yyyy] Work hours between date1 and date2 (8 hrs/day).
-Q [yyyy-mm-dd] Quarter from date (yyyy-mm-dd to yyyy_qq).
-q [mm/dd/yyyy] Quarter from date (mm/dd/yyyy to yyyy_qq).
-R ${T1} [${T2}] Elapsed time in seconds (input format 'yyyy-mm-dd').
-r ${T1} [${T2}] Elapsed time in 'hh:mi:ss' (input 'yyyy-mm-dd').
-S System date and time (yyyy-mm-dd hh:mi:ss).
-s System date and time (yyyy-mm-dd hh:mi:ss Day).
-T System date and time (mm/dd/yyyy hh:mi:ss).
-t System date and time (mm/dd/yyyy hh:mi:ss Day).
-U ${T1} [${T2}] Elapsed time between two events in seconds.
-u ${T1} [${T2}] Elapsed time between two events in 'hh:mi:ss'.
-V yyyy-mm-dd Verify date: if ok return (yyyy-mm-dd) else '9'.
-v mm/dd/yyyy Verify date: if ok return (mm/dd/yyyy) else '9'.
-W [yyyy-mm-dd] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-w [mm/dd/yyyy] Day of week (0-6, Sunday=0, Monday=1, Saturday=6).
-X [mm/dd/yyyy] Date in format 'yyyymmdd_doy_w_Day'.
-x System date and time in 'yyyymmdd_hhmiss_w_Day'.
-Y [yyyy-mm-dd] Convert date from format yyyy-mm-dd to mm/dd/yyyy.
-y [mm/dd/yyyy] Convert date from format mm/dd/yyyy to yyyy-mm-dd.
-Z [dd-mm-yyyy] Convert date from format dd-mm-yyyy to mm/dd/yyyy.
-? or -h List of options. (dtfn -? > dtfn.txt)
oracle@CURRENT-imgsrv1:/oracle/admin/aep_admin/library
K$ dtfn -s
2008-08-29 16:42:37 Fri
This is it compiled and running on AIX
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I am using Unix OpenServer Release 5.
When a run a application with user different to "Superuser" the application give me the following error:
"Memory Fault - Core Dump". What's that mean?
Thank you in advance.
Roberto Veras. (1 Reply)
Discussion started by: robertoveras
1 Replies
2. UNIX for Dummies Questions & Answers
We are running a SQR program on Unix Platform with Oracle RDBMS.
It's an interfacing program to integrate data from foreign sites to
PeopleSoft database, using a flat file input.
After many hours of processing, the program stops with a coredump error (memory fault). With top command we noticed... (1 Reply)
Discussion started by: araziki
1 Replies
3. Programming
Dear All,
I made a program which do some simple jobs like reading data from other process's shared memory and writing messages to the queues of other process.
what happens is my program works fine and do all the task as expected but then then program ends it give Memory fault(coredump). I... (0 Replies)
Discussion started by: ralo
0 Replies
4. Programming
When I excute a program .
It seems to generate an error : memory fault (core dump )
So how can i (1 Reply)
Discussion started by: iwbasts
1 Replies
5. UNIX for Advanced & Expert Users
Hi,
Am getting memory fault when i start ql session in SCO unix server.
Can any one suggest the way to solve this issue.
Thanks (0 Replies)
Discussion started by: param_it
0 Replies
6. Ubuntu
Hey guys,
I am new to the Linux world and have a question to post.
When I ssh from a HP-UX machine to a ubuntu machine I get the following error message
Memory fault(coredump)
i.e. ssh 192.168.1.3
I get this message as shown below
Memory fault(coredump)
Can someone please explain... (2 Replies)
Discussion started by: fkaba81
2 Replies
7. UNIX for Dummies Questions & Answers
I (think I) installed MYSQL on a Red Hat box. When I try to start mysql I get a memory fault error. Any ideas on how to fix this?
Here is some info that might help:
My distro info
$ cat /proc/version
Linux version 2.4.21-40.ELsmp (bhcompile@hs20-bc1-7 .build.redhat.com) (gcc version 3.2.3... (0 Replies)
Discussion started by: wsetchell
0 Replies
8. Linux
We have migrated our application from HP UX to linux. The code is in 4gl and after migration it has started giving Memory fault while running a batch job. The trace shows segmentation fault after a series of recvfrom and sendto(DB read)
sigsegv segmentation fault @ 0 0
killed by SIGSEGV
The... (2 Replies)
Discussion started by: aimee
2 Replies
9. UNIX for Dummies Questions & Answers
I am not sure where to post this so i will put it in the newbie section.
I have set up a bog standard debain 6, LAMP environment in the cloud.
The specs
1 core at 2GH
2.5gb Memory
running Jommla, with about 1.6K visitors a day.
I am using AppFirst (appfirst.com) to monitor the... (2 Replies)
Discussion started by: waseem
2 Replies
10. Homework & Coursework Questions
I am writing a program that copies a program and prints the program with a line count.
this is the program I wrote:
#include <stdio.h>
main()
{
int c;
int nl_cnt = 0;
while((c = getchar()) != EOF){
if(c = '\n'){
nl_cnt++;... (3 Replies)
Discussion started by: heywoodfloyd
3 Replies