Since India does not waste time with daylight saving time shifts, just setting TZ=IST-5:30 will give you the correct time in India at any time of year. For example, a few seconds ago:
produced the output:
wow..!! , i did not know that shell has the ability to treat first one as variable assignment and next one it expands into a command. Thats a new thing i learnt today. Thank you
Hi All,
I need to pass param on aix "errpt -a -s MMDDHHMMYY -e MMDDHHMMYY".
How do I read the date+time on the system and pass it as parameter? I need also the -s as previous day and the -e as current day.
Thanks,
itik (1 Reply)
Hi,
I have a log file with contents like
81.49.74.131 - -
81.49.74.131 - -
116.112.52.31 - -
116.112.52.31 - -
I need an output like this
81.49.74.131 14/Sep/2008 Time duration: 00:06:00
116.112.52.31 15/Sep/2008 Time duration: 00:00:01
Please anyone suggest a script for this.... (1 Reply)
Hi,
Can anybody tell me how to change time zone from ist to bst,
What changes should be done in /etc/TIMEZONE file.
wheather it is possible to change timezone without rebooting the server.
Regards
Manoj (1 Reply)
Hi,
I need to write a script, that will take the current date, time, and the output from # ps -eo pid,tid,class,rtprio,ni,pri,psr,pcpu,stat,wchan:14,comm
and spit it to a file, so it'll look like this...
PID TID CLS RTPRIO NI PRI PSR %CPU STAT WCHAN COMMAND
1 1 TS... (2 Replies)
give a date and time:
Jun 12 21:05:16
06-12-2012 21:05:16
2012/06/12 21:05:16
How can i subtract these dates and times from the current date and time and get back the difference in seconds?
a one liner like:
echo "Jun 12 21:05:16" | some perl/awk programming
90900s (2 Replies)
Hi,
I want to add some hours and minutes to the current date. For example, if the current date is "July 16, 2012 15:20", i want to add 5 hours 30 minutes to "July 16, 2012 00:00" not to "July 16, 2012 15:20". Please help.
Thanks! (4 Replies)
i have file 1.txt
asdas|csada|13|03|10|04|23|A1|canberra
sdasd|sfdsf|13|04|26|23|28|A1|sydney
i want to add today's date and time in the end of each row
expected output
asdas|csada|13|03|10|04|23|A1|canberra|130430|1358
sdasd|sfdsf|13|04|26|23|28|A1|sydney|130430|1358
todays date... (10 Replies)
I have below file which contain the date in column 3,4,5
12345 open 10/10/13 10:08 PM 3 application is in java
67899 open 12/10/13 2:31 AM 2 apps can be reach
23456 open 11/9/13 2:31 AM 4 java is OK
65432 open 12/10/13 10:07 PM 9 we are... (1 Reply)
I am trying to work on a script to grab the UTC time from a website
So far I was able to cobble this together.
curl -s --head web-url | grep ^Date: | sed 's/Date: //g'
Which gives me the result I need.
Wed, 06 Dec 2017 21:43:50 GMT
What I need to is extract the 21:43:50 and convert... (4 Replies)
Discussion started by: allisterB
4 Replies
LEARN ABOUT PLAN9
ctime
CTIME(2) System Calls Manual CTIME(2)NAME
ctime, localtime, gmtime, asctime, timezone - convert date and time to ASCII
SYNOPSIS
#include <u.h>
#include <libc.h>
char* ctime(long clock)
Tm* localtime(long clock)
Tm* gmtime(long clock)
char* asctime(Tm *tm)
/env/timezone
DESCRIPTION
Ctime converts a time clock such as returned by time(2) into ASCII (sic) and returns a pointer to a 30-byte string in the following form.
All the fields have constant width.
Wed Aug 5 01:07:47 EST 1973
Localtime and gmtime return pointers to structures containing the broken-down time. Localtime corrects for the time zone and possible day-
light savings time; gmtime converts directly to GMT. Asctime converts a broken-down time to ASCII and returns a pointer to a 30-byte
string.
typedef
struct {
int sec; /* seconds (range 0..59) */
int min; /* minutes (0..59) */
int hour; /* hours (0..23) */
int mday; /* day of the month (1..31) */
int mon; /* month of the year (0..11) */
int year; /* year A.D. - 1900 */
int wday; /* day of week (0..6, Sunday = 0) */
int yday; /* day of year (0..365) */
char zone[4]; /* time zone name */
} Tm;
When local time is first requested, the program consults the timezone environment variable to determine the time zone and converts accord-
ingly. (This variable is set at system boot time by init(8).) The timezone variable contains the normal time zone name and its difference
from GMT in seconds followed by an alternate (daylight) time zone name and its difference followed by a newline. The remainder is a list
of pairs of times (seconds past the start of 1970, in the first time zone) when the alternate time zone applies. For example:
EST -18000 EDT -14400
9943200 25664400 41392800 57718800 ...
Greenwich Mean Time is represented by
GMT 0
SOURCE
/sys/src/libc/9sys
SEE ALSO date(1), time(2), init(8)BUGS
The return values point to static data whose content is overwritten by each call.
Daylight Savings Time is ``normal'' in the Southern hemisphere.
These routines are not equipped to handle non-ASCII text, and are provincial anyway.
CTIME(2)