Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

datetime(3) [debian man page]

datetime(3)						     Library Functions Manual						       datetime(3)

NAME
datetime - convert between TAI labels and seconds SYNTAX
#include <datetime.h> void datetime_tai(&dt,t); datetime_sec datetime_untai(&dt); struct datetime dt; datetime_sec t; DESCRIPTION
International Atomic Time, TAI, is the fundamental unit for time measurements. TAI has one label for every second of real time, without complications such as leap seconds. A struct datetime variable, such as dt, stores a TAI label. dt.year is the year number minus 1900; dt.mon is the month number, from 0 (January) through 11 (December); dt.mday is the day of the month, from 1 through 31; dt.hour is the hour, from 0 through 23; dt.min is the minute, from 0 through 59; dt.sec is the second, from 0 through 59; dt.wday is the day of the week, from 0 (Sunday) through 6 (Saturday); dt.yday is the day of the year, from 0 through 365. The datetime library supports more convenient TAI manipulation with the datetime_sec type. A datetime_sec value, such as t, is an integer referring to the tth second after the beginning of 1970 TAI. The first second of 1970 TAI was 0; the next second was 1; the last second of 1969 TAI was -1. The difference between two datetime_sec values is a number of real-time seconds. datetime_tai converts a datetime_sec to a TAI label. datetime_untai reads a TAI label (specifically dt.year, dt.mon, dt.mday, dt.hour, dt.min, and dt.sec) and returns a datetime_sec. SEE ALSO
now(3) datetime(3)

Check Out this Related Man Page

POSIX::strptime(3pm)					User Contributed Perl Documentation				      POSIX::strptime(3pm)

NAME
POSIX::strptime - Perl extension to the POSIX date parsing strptime(3) function SYNOPSIS
($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime("string", "Format"); DESCRIPTION
Perl interface to strptime(3) FUNCTIONS
strptime ($sec, $min, $hour, $mday, $mon, $year, $wday, $yday) = POSIX::strptime(string, format); The result for any value not extracted is not defined. Some platforms may reliably return "undef", but this is dependent on the strptime(3) function in the underlying C library. For example, only the following fields may be relied upon: my ($min, $hour) = ( POSIX::strptime( "01:23", '%H:%M' ) )[1,2]; my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5]; Furthermore, not all platforms will set the $wday and $yday elements. If these values are required, use "mktime" and "gmtime": use POSIX qw( mktime ); use POSIX::strptime qw( strptime ); my ($mday, $mon, $year) = ( POSIX::strptime( "2010/07/16", '%Y/%m/%d' ) )[3,4,5]; my $wday = ( gmtime mktime 0, 0, 0, $mday, $mon, $year )[6]; SEE ALSO
strptime(3) AUTHOR
Philippe M. Chiasson <gozer@cpan.org> Kim Scheibel <kim@scheibel.co.uk> REPOSITORY
http://svn.ectoplasm.org/projects/perl/POSIX-strptime/trunk/ COPYRIGHT
Copyright 2005 by Philippe M. Chiasson <gozer@cpan.org>. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html perl v5.14.2 2010-07-16 POSIX::strptime(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Check if a day eg: saturday is the Last saturday of the month!

Hi, I need to develop a script to check for the day. If the day is a Saturday then the script should check if the Saturday is the last Saturday of the month so that certain set of instruction can be executed is it is the last Saturday. I do not want to use the crontab as this needs to be part... (9 Replies)
Discussion started by: jobbyjoseph
9 Replies

2. Shell Programming and Scripting

Problem with timegm function in perl

Hello.. In my code i use the following function: $epochTime = timegm($sec, $min, $hour, $day, $month, $year) The problem is that when $day==31, i get the following error: Day '31' out of range 1..30 at unrated_namp_program line 113 Any idea how to overcome this??? Thank you very... (5 Replies)
Discussion started by: chriss_58
5 Replies

3. UNIX for Dummies Questions & Answers

Strip time from date in a file

I have a couple of datetime fields in a file with contents like below: ICPBR|6373056085|1|O||||JOHN|SMITH|||H200|706|445668|||123 SMITH ST|LAGRANGE|IL|66666 |||||||N|N|N|N|N|||345676|2009.02.20-13:09:04|257655957|2009.02.20-13:09:04||||N|||||F||||||||||| I want to strip the time off the... (4 Replies)
Discussion started by: ChicagoBlues
4 Replies

4. Shell Programming and Scripting

To verify whether the year has all the digits

I have a code unit based on which i have this code snippet year='2009' echo year is $year if )@()@()@() ]] then echo 'year in error' fi echo end of program Here i want to find whether all the characters in the variable year are numbers. I am not sure whether this works or not because... (5 Replies)
Discussion started by: rak007
5 Replies

5. Shell Programming and Scripting

Script to change Timezone(Solaris)

india 22/11/2009 10:00:00 AM sweden 22/11/2009 01:30:00 PM As mentioned above i will get the datetime string from my customer and i need to change that String into diffrnt timezone as mentioned above. ---------- Post updated at 01:54 AM ---------- Previous update was at 01:01 AM ----------... (5 Replies)
Discussion started by: vikas482
5 Replies

6. Shell Programming and Scripting

Date operations in Unix?

Hi Friends, I need help in below requirements, 1. I have to get current datetime + <mins> into a variable 2. I have to compage dates like, A=01-JAN-2009 10:20:10 B=01-JAN-2009 10:30:00 C=<same format date as above> I have to find whether, 1. C is less than A OR, 2. C is greater... (7 Replies)
Discussion started by: smr_rashmy
7 Replies

7. AIX

Probléme pour agrandir LV et FS

Bonjour, Je travail sur un environnement AIX 5.3 et je n'arrive pas ŕ augmenter mon FS ni mon LV. J'utilise les commande suivante chfs -a size=+4G /home/guesting ou extendlv sybase5lv 4 et rien ŕ faire il me retourne que le maximum capacity est atteint au niveau du LV alors qu'il y a des PP de... (6 Replies)
Discussion started by: mosta
6 Replies

8. Shell Programming and Scripting

delete only part of a line

Hi, I've a file as below- I need to delete only the part of the line after the pattern 'extent /lock' and my output has to be like below. Thanks (7 Replies)
Discussion started by: dvah
7 Replies

9. Shell Programming and Scripting

datetime difference in seconds

Hi, I'm trying to find processing time of my script. Please can someone give me the commands to get the start/end time in "dd-mm-yyyy hh:mm:ss" and the differnce in seconds. Thanks! (5 Replies)
Discussion started by: dvah
5 Replies

10. Shell Programming and Scripting

Awk convert from day of year to date

Hello everyone, I have a file which has day of year in one of the columns (JD=substr($0,72,3)). The bellow scripts shows me the minimum and maximum values of the JD and I would like to convert the JD to date. #!/bin/gawk -f { check=substr($0,1,1) if (check == "S") { ... (6 Replies)
Discussion started by: alex2005
6 Replies

11. UNIX for Dummies Questions & Answers

Help with a script

Lets say I have a file suffixed with a year eg: test_file_2010.txt which has some 40 records So now, the requirement is, Since the file has the year "2010" suffixed, I just want to add a column say FY10 and under it everything else should be FY10 again(40 rows) FY!0(column) FY10 FY10... (9 Replies)
Discussion started by: saggiboy10
9 Replies

12. Shell Programming and Scripting

moving files which have a datetime >= currentdate-N

Hi , I want to move the files from a particular folder which have a datetime >= currentdate-N from a source to destination folder. for ex today date is 22/10/2011 and the value of 'N' is 2 days then it should do the logic datetime >= currentdate-N that is 22/10/2011 - 2days so it will... (5 Replies)
Discussion started by: rahul125
5 Replies

13. Shell Programming and Scripting

create more than 100 directories and copy files into them

Hi, I have several files containing experiment measurements per hour (hour_1.txt has measurements for first hour, etc..etc..). I have 720 of these files (i.e. up to hour_720.txt) and i want to create 720 directories and in every one of them i want to copy its associative file (e.g.... (4 Replies)
Discussion started by: amarn
4 Replies

14. Shell Programming and Scripting

How to convert 24 hour time to 12 hour timing?

Hi friends, I want to convert 24 hour timing to 12 hour please help me... my data file looks like this.. 13-Nov-2011 13:27:36 15.32044 72.68502 13-Nov-2011 12:08:31 15.31291 72.69807 16-Nov-2011 01:16:54 15.30844 72.74028 15-Nov-2011 20:09:25 15.35096 ... (13 Replies)
Discussion started by: nex_asp
13 Replies

15. UNIX for Advanced & Expert Users

Script execution

I need to call a script if the month end falls on Saturday or Sunday (5 Replies)
Discussion started by: bala1985
5 Replies