Convert unix timestamp to year month day format ?


 
Thread Tools Search this Thread
Operating Systems AIX Convert unix timestamp to year month day format ?
# 1  
Old 01-06-2010
Convert unix timestamp to year month day format ?

Hello,

How do I convert unix timestamp value to 'normal' date format - to get year month and day values ?
Looks like it's easy to do using GNU date (linux systems). But how do I do tthis on AIX ?
I don't want to write C program, any ways to do that using unix shells ?

thanks
# 2  
Old 01-06-2010
Hi ,

try this

perl -le 'print scalar localtime 1233074134'
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Convert date in dd mm yyyy format to UNIX timestamp

Hello All, I have a date in DD/MM/YYYY format. I am trying to convert this into unix timestamp. I have tried following: date -d $mydate +%s where mydate = 23/12/2016 00:00:00 I am getting following error: date: extra operand `+%s' Try `date --help' for more information. ... (1 Reply)
Discussion started by: angshuman
1 Replies

2. Shell Programming and Scripting

Convert UNIX timestamp to readable format in the file

Hello I have a file : file1.txt with the below contents : 237176 test1 test2 1442149024 237138 test3 test4 1442121300 237171 test5 test7 1442112823 237145 test9 test10 1442109600 In the above file fourth field represents the timestamp in Unix format. I found a command which converts... (6 Replies)
Discussion started by: rahul2662
6 Replies

3. Shell Programming and Scripting

Julian day to dates in YEAR-MONTH-DAY

hello, I have many files called day001, day002, day003 and I want to rename them by day20070101, day20070102, etc. I need to do it for several years and leap years as well. What is the best way to do it ? Thank you. (1 Reply)
Discussion started by: Ggg
1 Replies

4. Shell Programming and Scripting

Day of year to dd.mm.yyyy format

Hi, How can I convert day of year value in format(yy,doy) to normal formatted (dd.mm.yyyy) string also all of them with awk or awk system function? in_file.txt --------- 12,043 12,044 12,045 12,046 out_file.txt ---------- 12.02.2012 13.02.2012 14.02.2012 15.02.2012 imagine... (5 Replies)
Discussion started by: kocaturk
5 Replies

5. 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

6. Shell Programming and Scripting

To convert a date(in string format) to unix timestamp

Hi All, I have a string like below. "Mar 31 2009" . I want to convert this to unix time . Also please let me know how to find the unix time for the above string minus one day. For Eg. if i have string "Mar 31 2009" i want to find the unix time stamp of "Mar 30 2009". Thanks in advance,... (11 Replies)
Discussion started by: girish.raos
11 Replies

7. Shell Programming and Scripting

Concatenating Files In A Year/Month/Day File Structure

Hi Im trying to concatenate a specific file from each day in a year/month/day folder structure using Bash or equivalent. The file structure ends up like this: 2009/01/01/products 2009/01/02/products .... 2009/12/31/products The file I need is in products everyday and I need the script to... (3 Replies)
Discussion started by: Grizzly
3 Replies

8. Shell Programming and Scripting

Script to find previous month last day minus one day timestamp

Hi All, I need to find the previous month last day minus one day, using shell script. Can you guys help me to do this. My Requirment is as below: Input for me will be 2000909(YYYYMM) I need the previous months last day minus 1 day timestamp. That is i need 2000908 months last day minus ... (3 Replies)
Discussion started by: girish.raos
3 Replies

9. Shell Programming and Scripting

Get yesterday's date in year-month-day format?

Dear All, Actually, i'm doing some reporting job and i need to pass yesterday's date in Year-Month-Day format(e.g. 2009-06-10) to another program for generating 2009-06-10 report. to get today's date, it's easy to just date '+%Y%m%d' , but no idea how can i get this kind of format for... (2 Replies)
Discussion started by: tiger2000
2 Replies

10. Shell Programming and Scripting

Day of month and year to mmddyyyy

I have a date that looks like this: 2008/100:18:40:47.040 I need it to look like this: 2008 04 09 18 40 47 040 I have looked at datecalc and it doesn't seem like it takes the day of year for this year (or whatever year is input) and converts it into month and day. It also has to account... (2 Replies)
Discussion started by: ajgwin
2 Replies
Login or Register to Ask a Question