Question about Paderabo date script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question about Paderabo date script
# 1  
Old 09-04-2006
Question about Paderabo date script

The date outputs the difference in this format YYYYMD. I think it would be better to have the output as YYYYMMDD. Im having problem processing the format.

Thank you
# 2  
Old 09-04-2006
about having the output a lot simpler

September 4, 11:48:14 AM 2006 Monday EDT


instead of that annoying military times
Terrible
# 3  
Old 09-04-2006
I will ignore Terrible's comment because my script works with dates only. It has nothing to do with clock time in any format.

Kayarsenal, my script outputs stuff as y m d not yyyymd. That is year, month, and day are output as separate fields. The range of dates that it is will to work with is Jan 1, 1860 though Dec 31, 3999 and this happens to have the side effect of limiting year to exactly 4 digits. I avoided leading zeros because Posix requires that integers with leading zeros be interpreted as octal thus rendering 08 and 09 as illegal integers. If you want leading zeros anyway, store the month and day into variables that were listed in a "typeset -Z2" statement.
# 4  
Old 09-04-2006
followup

Hi Pade,
You mean I should edit the datecalc script? Where exactly to edit to have the YYYYMMDD output? Thank you
# 5  
Old 09-04-2006
Quote:
Originally Posted by Perderabo
I will ignore Terrible's comment because my script works with dates only. It has nothing to do with clock time in any format.

Kayarsenal, my script outputs stuff as y m d not yyyymd. That is year, month, and day are output as separate fields. The range of dates that it is will to work with is Jan 1, 1860 though Dec 31, 3999 and this happens to have the side effect of limiting year to exactly 4 digits. I avoided leading zeros because Posix requires that integers with leading zeros be interpreted as octal thus rendering 08 and 09 as illegal integers. If you want leading zeros anyway, store the month and day into variables that were listed in a "typeset -Z2" statement.

whoa. i wasn't ridiculing ur date script. i dont know what it is cause i've actually never seen it. i was just saying it'd be nice to have someone rewrite the date command so folks like me who like things easy dont have to look at that military type format when u always goto minus 12 to get the exact time. that i hate
Terrible
# 6  
Old 09-05-2006
Quote:
whoa. i wasn't ridiculing ur date script. i dont know what it is cause i've actually never seen it. i was just saying it'd be nice to have someone rewrite the date command so folks like me who like things easy dont have to look at that military type format when u always goto minus 12 to get the exact time. that i hate
We are not here to discuss your likes and dislikes, if you are not sure what about OP has asked, why you bothered to reply in this thread? I think it would be better to close this thread now.
# 7  
Old 09-05-2006
Quote:
Originally Posted by shereenmotor
it would be better to close this thread now.

this sounds about right
Terrible
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Compare Date to today's date in shell script

Hi Community! Following on from this code in another thread: #!/bin/bash file_string=`/bin/cat date.txt | /usr/bin/awk '{print $5,$4,$7,$6,$8}'` file_date=`/bin/date -d "$file_string"` file_epoch=`/bin/date -d "$file_string" +%s` now_epoch=`/bin/date +%s` if then #let... (2 Replies)
Discussion started by: Greenage
2 Replies

2. Linux

How to calculate the quarter end date according to the current date in shell script?

Hi, My question is how to calculate the quarter end date according to the current date in shell script? (2 Replies)
Discussion started by: Divya_1234
2 Replies

3. UNIX for Beginners Questions & Answers

UNIX script to replace old date with current date dynamically in multiple files present in a folder

I am trying to work on a script where it is a *(star) delimited file has a multiple lines starts with RTG and 3rd column=TD8 I want to substring the date part and I want to replace with currentdate minus 15 days. Here is an example. iam using AIX server $ cat temp.txt RTG*888*TD8*20180201~... (1 Reply)
Discussion started by: Shankar455
1 Replies

4. Shell Programming and Scripting

Script to copy creation date over top of modified date?

Can someone draw up a script that for every file, folder and subfolder and files that will copy the creation date over top of the modified date?? I know how to touch every file recursively, but no idea how to read a files creation date then use that to touch the modification date of that file,... (3 Replies)
Discussion started by: toysareforboys
3 Replies

5. Shell Programming and Scripting

Script to determine Date,TotalFile,total size of file based on date

I have file listed like below -rw-r--r--+ 1 test test 17M Nov 26 14:43 test1.gz -rw-r--r--+ 1 test test 0 Nov 26 14:44 test2.gz -rw-r--r--+ 1 test test 0 Nov 27 10:41 test3.gz -rw-r--r--+ 1 test test 244K Nov 27 10:41 test4.gz -rw-r--r--+ 1 test test 17M Nov 27 10:41 test5.gz I... (5 Replies)
Discussion started by: krish2014
5 Replies

6. Shell Programming and Scripting

Shell script to compare two files of todays date and yesterday's date

hi all, How to compare two files whether they are same are not...? like i had my input files as 20141201_file.txt and 20141130_file2.txt how to compare the above files based on date .. like todays file and yesterdays file...? (4 Replies)
Discussion started by: hemanthsaikumar
4 Replies

7. UNIX for Dummies Questions & Answers

How to write a shell script to Run it the from Date A to Date B?

Hi , How would i write a shell script to run the code from one date to another date EXample 2014-01-01 to 2014-02-28, can i any provide some clue on this (4 Replies)
Discussion started by: vikatakavi
4 Replies

8. Shell Programming and Scripting

Need help in Shell Script comparing todays date with Yesterday date from Sysdate

Hi, I want to compare today's date(DDMMYYYY) with yesterday(DDMMYYYY) from system date,if (today month = yesterday month) then execute alter query else do nothing. The above requirement i want in Shell script(KSH)... Can any one please help me? Double post, continued here. (0 Replies)
Discussion started by: kumarmsk1331
0 Replies

9. Shell Programming and Scripting

How to increment a user defined date value in the DATE format itself using shell script?

I need to increment a date value through shell script. Input value consist of start date and end date in DATE format of unix. For eg. I need increment a date value of 1/1/09 to 31/12/09 i.e for a whole yr. The output must look like 1/1/09 2/2/09 . . . 31/1/09 . . 1/2/09 . 28/2/09... (1 Reply)
Discussion started by: sunil087
1 Replies

10. Shell Programming and Scripting

Specify a previous date as start date in shell script

Hi, I am trying to modify a script which accepts date in format dd/mm/yy. I am trying to modify the script so that it retrieves the date that was 15 days earlier from today as start date. Eg.if today is 05/09/2006, the script should retrieve 21/08/2006 as start date. Is there any script/code to... (2 Replies)
Discussion started by: ritzwan0
2 Replies
Login or Register to Ask a Question