Sponsored Content
Top Forums Shell Programming and Scripting Generate last hour date in YYYYmmddHH Post 302504647 by alvin0618 on Tuesday 15th of March 2011 05:25:02 AM
Old 03-15-2011
Quote:
Originally Posted by Ygor
Yup...
Code:
$ gawk 'BEGIN{print strftime("%Y %m %d %H", systime() - (60 * 60))}'
2011 03 15 15

I need crossover others platform between GNC and Suns. Suns can't run this code. Do you have other solution? Kindly appreciate your reply. TQ
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

generate rows from date.

Hi I have file like below has many rows with different dates and ids. ID FIRST_DT SEC_DT 111 2005-10-02 2010-10-01 222 2007-11-01 2040-09-13 I need to generate rows first_dt increment + 1 year until the SEC_DT year matches ,ID and sec_dt stays same ,here... (14 Replies)
Discussion started by: GrepMe
14 Replies

2. Shell Programming and Scripting

Get date and time for past 1 hour from current date

Hi, I need to get the date and time for past 1 hour from the current date. Anyone know how to do so? Thanks (5 Replies)
Discussion started by: spch2o
5 Replies

3. Shell Programming and Scripting

Unix Script for getting date and validating just Hour

Hi, Can someone guide me to write a unix script for getting a hour out of a date command and validating hour to see if its > 7 and < 16. if hours is >7 and <16 then assign a variable value of 0730 and if hour is >16 then assign a variable value of 1630? Help appreciated. Thanks in advance.... (9 Replies)
Discussion started by: zulfikarmd
9 Replies

4. Shell Programming and Scripting

Compare file timestamp with current date. Diff must be 1 hour.

Hello, I've created the script below to compare the content of two files with a delay of an hour. After an hour, the lines that exist in both files, will be printed and executed. The script now uses a counter to countdown 50 minutes. But what I would prefer is to check the file timestamp of... (3 Replies)
Discussion started by: taipan
3 Replies

5. Shell Programming and Scripting

Help to generate date from day of the year

Hi I want to convert the day of the year(yyyyddd) to date in mmddyy format Example: input is 2005029 --------> 29th day of 2005 I have to get the output as 01292005 ---> jan 29th 2005 I've to do this in K-Shell There were threads that dealt with coverting date to day of the year but I... (3 Replies)
Discussion started by: sudhamayeev
3 Replies

6. Shell Programming and Scripting

Generate quarter dates with begin date and end date

Hi All, I am trying to generate quarter dates with user giving input as begin date and end date. Example: Input by user: begin_date = "2009-01-01" end_date = 2010-04-30" required output: 2009-01-01 2009-03-31 09Q01 2009-04-01 2009-06-30 09Q02 . . till 2010-01-01 2010-03-31 10Q01 ... (9 Replies)
Discussion started by: sol_nov
9 Replies

7. Shell Programming and Scripting

Finding/Grep on files with date and hour in the file name

Hi, I have a folder structure as follows, DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt -> 01 -> ABC_2012-01-03_01.txt -> 02 -> ABC_2012-01-03_02.txt ... -> 23 -> ABC_2012-01-03_02.txt -> 2012-01-02 -> 2012-01-03 So the dir DATA contains the above hierarchy, User input Start and... (6 Replies)
Discussion started by: mihirvora16
6 Replies

8. UNIX for Advanced & Expert Users

Finding/Grep on files with date and hour in the file name

Hi, I have a folder structure as follows, DATA -> 2012-01-01 -> 00 -> ABC_2012-01-03_00.txt -> 01 -> ABC_2012-01-03_01.txt -> 02 -> ABC_2012-01-03_02.txt ... -> 23 -> ABC_2012-01-03_02.txt -> 2012-01-02 ... (1 Reply)
Discussion started by: mihirvora16
1 Replies

9. Solaris

Solaris 9 Zone : Date command in crontab shows delayed(One Hour) output

SOLARIS 9 Zone : date command in crontab shows delayed(One Hour) output Hi folks, the date command shows the correct date and time, How ever, if the date command executed through crontab in any form of scrip the output shows as one hour delayed, similar to date -u.. Can some one help in... (12 Replies)
Discussion started by: judi
12 Replies

10. Shell Programming and Scripting

Day/Hour diff between two date

Dear All I need to find out day diff between two dates. date -d or date -- day is not working in mine system. Currently i am using below code but it gives me wrong value while month change. IP: Date 1: 20150802 11:30:45 Date 2: 20150728 16:30:45 code used: awk '{t1=$2; t2=$4;... (7 Replies)
Discussion started by: jaydeep_sadaria
7 Replies
lunar(1)						      General Commands Manual							  lunar(1)

NAME
lunar (version 2.2) - a calendar conversion utility SYNTAX
lunar [ -h ] [ -b ] [ -i ] [ -l ] year month day [ hour ] DESCRIPTION
The program performs date conversion between the Gregorian Solar Calendar (SC) and the Chinese Lunar Calendar (LC). Given a date in either calendar, the program also outputs the corresponding "shengxiao" (animal of the year) and "ganzhi" characters. The date range currently covered is from about 1900 A.D. to 2049 A.D. For the sake of convenience, we choose the convention such that the solar and lunar year numbers of the first day of a lunar year are the same. For example, SC 1991.2.15 is LC 1991.1.1, while SC 1991.2.14 is LC 1990.12.30. Moreover, we choose the convention such that the solar and lunar hour numbers (in 24-hour clock) of a date are the same, although a lunar day starts at 23:00 of a solar day. This means that SC 1991.2.15.23 is LC 1991.1.2.23, while SC 1991.2.16.0 is LC 1991.1.2.0, and SC 1991.2.16.1 is LC 1991.1.2.1. The standard time of the Lunar Calendar is Beijing (Hong Kong) Standard Time, not GMT. Be sure to adjust appropriately for other time zones and "Daylight Saving Time". In the Lunar Calendar, a normal year has 12 months, and a leap year (run-nian) has 13 months, where the extra month is called a "leap month" (run-yue). For example, the leap month that follows immediately the 6-th lunar month is called the 6-th leap month. A (leap) month is either a short or long one, which has 29 or 30 days respectively. There are 10 gan's and 12 zhi's. The ganzhi labeling of the year, month, day and hour of a date is a member of the Cartesian product GxGxGxG, where G = {1,2,...,60}. For example, "jia-zi" is 1, "yi-chou" is 2, and so on. The ganzhi of the j-th leap month is the same as that of the j-th month. The possible options are b output ganzhi in special "bitmap" characters. h output hanzi or Chinese characters encoded in (highest-bit-set) GB code. i convert a lunar date to solar date. The default is to convert a solar date to a lunar date. l indicate the month is a lunar leap month. This option is meaningful only when the "-i" option is used. COPYRIGHT
Copyright (C) 1988, 1989, 1991, 1992, 2001 Fung F. Lee and Ricky Yeung This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MER- CHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. The last version of this program was released on July 23, 1992 as version 2.1a. This program was first released under the terms of GNU GPL on October 28, 2001 as version 2.2. Both versions are identical except for the license text. AUTHORS
Fung F. Lee and Ricky Yeung ACKNOWLEDGEMENT
The special "bitmap" file "lunar.bitmap" was contributed by Weimin Liu. Special thanks to Hwei Chen Ti who extended the tables from 2001 to 2049. BUGS
Bug reports and comments should be sent to lee@umunhum.stanford.edu. DISCLAIMER
This software has no connection with our employers. 28 October 2001 lunar(1)
All times are GMT -4. The time now is 01:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy