Sponsored Content
Top Forums Shell Programming and Scripting get yesterday in yyyymmdd format Post 78143 by Euler04 on Friday 15th of July 2005 08:26:44 PM
Old 07-15-2005
This does works exept for the 1st day of the month.
Code:
date | awk '{printf"%4d%2d%2d\n",$6,$2,($3-1)}' | sed 's/ /0/g'

 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

get yesterday date in yyyymmdd format

I would like to know how I could get a yesterday date in yyyymmdd e.g. today is 20011109, and I would like to get 20011108. Thank you!:confused: (2 Replies)
Discussion started by: hk_newbie
2 Replies

2. HP-UX

How can i get the yesterday's date in YYYYMMDD format

How can i get the yesterday's date in YYYYMMDD format??? (4 Replies)
Discussion started by: prasadsr
4 Replies

3. UNIX for Dummies Questions & Answers

Format date from MM/DD/YYYY to YYYYMMDD

I have a file with some date columns in MM/DD/YYYY format: SMPBR|DUP-DO NOT USE|NEW YORK||16105|BA5270715|6/6/2007 |MWERNER|109||||JOHN||SMITH|MD|72211118||||||74559|21 WILMINGTON RD||D|11/6/2003|SL# MD CONTACT-LIZ RICHARDS|||0|Y|N||1411458| And I want to convert the date format to: ... (5 Replies)
Discussion started by: ChicagoBlues
5 Replies

4. Shell Programming and Scripting

convert date format YYYYMMDD to MM/DD/YYYY

In my shell script i have a variable which stores date in the format of YYYYMMDD. Is there any way to format this value to MM/DD/YYYY. Thanks. (8 Replies)
Discussion started by: nasirgondal
8 Replies

5. Shell Programming and Scripting

Find the next day from 20100303 (YYYYMMDD format)

Hi , i have doubt in bash shell script.. for example my file name is sampledate.sh given command = ./sampledate.sh -d 20100303 -f karthi how to find the next day from 20100303 (YYYYMMDD format) After getting the next day ,changed date and -f argument value will be sent to one java class. ... (13 Replies)
Discussion started by: karthinvk
13 Replies

6. Shell Programming and Scripting

Change the date format from mmddyyyy to yyyymmdd

How do I change the date format from mmddyyyy to yyyymmdd in PERL. Can any one help me please. (3 Replies)
Discussion started by: thankful123
3 Replies

7. Solaris

Date after 5 dates in YYYYMMDD format

Hi Experts, How to get date 5 days after current date in YYYYMMDD format? How do we compare date in YYYYMMDD format? Thanks (1 Reply)
Discussion started by: needyourhelp10
1 Replies

8. Shell Programming and Scripting

Validating date in yyyymmdd format using PERL

Hi all, i had a code where in user will enter a date in yyyymmdd format.. i didnt use any validation for the date and now the problem is if a user enters date instead of month after year it is proceeding with the code.. like if the date is 20120426 and if the user enters 20122604 it... (4 Replies)
Discussion started by: smarty86
4 Replies

9. Shell Programming and Scripting

Date format to be changed from DDMMYYYY to YYYYMMDD

My requirement is:- there will be files at a location each day with the date format DDMMYYYY. Novawise_Activity_Call_Notes_04022013.txt Novawise_Activity_Inbound_04022013.txt Novawise_Activity_Inbound_05022013.txt Novawise_Activity_Call_Notes_05022013.txt... (8 Replies)
Discussion started by: djrulz123
8 Replies

10. Shell Programming and Scripting

How to conver YYYYMMDD to MJD format?

I would like to convert YYYYMMDD to MJD format for eg 20041223 converted to 53362 in MJD format i got logic from javascript to covert it to MJD which is long enough function YMDtoMJD (year, month, day) { var year; var monthi var day; var yr = Math.floor (year); ... (1 Reply)
Discussion started by: mandalmanas24
1 Replies
mhc(5)								File Formats Manual							    mhc(5)

NAME
mhc - Message Harmonized Calendaring system DESCRIPTION
This manual page documents briefly the mhc file format. This manual page was written for the Debian GNU/Linux distribution because the original program does not have a manual page. FIELDS
Mhc file format is based on STD11/RFC822: Standard for the format of ARPA Internet text messages. In mhc file, the following extra header fields are used. X-SC-Day: Date of event in format yyyymmdd. You can specify multiple date with space separated like: X-SC-Day: 19990409 19990413 which means April 9th 1999 and April 13th 1999. X-SC-Time: Time of event in format hh:mm-hh:mm or hh:mm. For event which has no meanings about time, you can leave it empty in this field. X-SC-Duration: Period of event in yyyymmdd-yyyymmdd. You can omit start date or end date, like "19991121-". X-SC-Duration: is used only to limit date specified by X-SC-Day: or X-SC-Cond, so you can't describe event date only by X-SC-Duration:. If X-SC-Duration: is empty, it means no limit. X-SC-Cond: Condition of event date by using following keyword. 00-31 Day of month. 1st 2nd 3rd 4th 5th Last Week in month. Sun Mon ... Sat Day of week. Jan Feb ... Dec Month Examples, X-SC-Cond: Tue Fri Every Tuesday and Friday. X-SC-Cond: 31 Aug Every August 31th. X-SC-Cond: 1st 3rd Fri Every 1st and 3rd Friday. X-SC-Cond: Fri X-SC-Day: !19990409 Every Friday, but except April 9th 1999. X-SC-Cond: Fri 13 Every 13th and Every Friday, not 13th Friday. X-SC-Alarm: Hint for alarm of event. Currently, mhc.el doesn't alaram, but gemcal will pop-up alarm window. It will be useful if you transfer this event to PalmOS. In X-SC-Alarm:, you can specify the number (1 to 99) with suffix such as minute, hour or day. For example, X-SC-Alarm: 10 minutes Alarm 10 minutes before event. X-SC-Alarm: 3 hour Alarm 3 hours before event. X-SC-Alarm: 3 day Alarm 3 day before event. X-SC-Subject: Subject of event. unstructured? X-SC-Location: Location of event. unstructured? X-SC-Category Category of event. Any keyword, space separeated. Case ignored. X-SC-Recoard-Id: Internal use only. SEE ALSO
adb2mhc(1) gemcal(1), mhc-sync(1), mhc2palm(1), palm2mhc(1), today(1). AUTHOR
This program was written by Yoshinari Nomura <nom@quickhack.net> and this manual page was written by Fumitoshi UKAI <ukai@debian.or.jp>, for the Debian GNU/Linux system (but may be used by others). 23 Jun 2000 mhc(5)
All times are GMT -4. The time now is 07:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy