10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
Hi,
I have a file where I need to change the date format on the nth field from DD-MM-YYYY to YYYY-MM-DD so I can accurately sort the record by dates
From regex - Use sed or awk to fix date format - Stack Overflow, I found an example using nawk.
Test run as below:
$: cat xyz.txt
A ... (2 Replies)
Discussion started by: newbie_01
2 Replies
2. Shell Programming and Scripting
How can I convert the following date format:
New Log Date = 2016-12-30 23:50:33 GMT
from GMT time to local time?
Thanks (13 Replies)
Discussion started by: mrn6430
13 Replies
3. Programming
Hi. I have timestamps that I am trying to convert to epoch time. An example:
I am trying to convert this to an epoch timestamp but have one little glitch. I have this:
import time
date_time = ''
pattern = ''
epoch = int(time.mktime(time.strptime(date_time, pattern)))
print epoch... (1 Reply)
Discussion started by: treesloth
1 Replies
4. Shell Programming and Scripting
I have searched and the answers I have found thus far have led me to this point, so I feel I am just about there.
I am trying to convert a column of hexadecimal to decimal values so that I can filter out via grep just the data I want. I was able to pull my original 3 character hex value and... (10 Replies)
Discussion started by: PCGameGuy
10 Replies
5. Shell Programming and Scripting
Looking for some help and usually when I do a search this site comes up. Hopefully someone can give me a little direction as to how to use one of these two commands to achieve what I'm trying to do.
What am I trying to do?
I need to take the time value in epoch format returned from the... (5 Replies)
Discussion started by: minigts
5 Replies
6. Shell Programming and Scripting
Nawk ‘BEGIN {printf “0t%d=Y\n”,srand () -1800}' | adb
I know that printf is printing the value in %d which is for a day of the month and subtracting the value by -1800 (30 minutes).
So if date is 14:25:45 subtracting from 1800 then time will equal to 13:55:45
I also know that srand () is... (1 Reply)
Discussion started by: INHF
1 Replies
7. Shell Programming and Scripting
My local server is in UTC time whereas my remote server in in CST time.
I get a sequential file from CST time server and the records in will contain the first line as a filename and the second line as date time like mentioned below.
/abc/cde/f1.txt
2009-04-28 23:10:05 CST
Now i need to... (3 Replies)
Discussion started by: HemaV
3 Replies
8. Programming
Hi frnds,
I have written a code to get current time
struct tm *locTime;
time_t currentTime;
time( ¤tTime );
locTime = localtime(¤tTime );
Suppose now i get output time as 31-DEC-2007 00:00:00
What i want now is i want two strings where in one string i want to subtract... (1 Reply)
Discussion started by: electroon
1 Replies
9. Shell Programming and Scripting
Hi All,
I am using solaris and nawk.
Is there any time function in nawk which is simliar to the shell `date` function ?
Can any experts show any examples? (4 Replies)
Discussion started by: Raynon
4 Replies
10. UNIX for Advanced & Expert Users
Hi,
Is there any way to get current time for a particular country using any unix command ?
I mean, If i want to find out current time in US or UK or anything ....
Any command or library routine available for that?
How it can be done in C on Unix?
Can anybody help me?
Thanks
--... (1 Reply)
Discussion started by: kamlakar
1 Replies