Hi All,
I want to find the previous day's date and store that in a variable, which will be usuful for further processing.
Any help please.
Regards,
raju (4 Replies)
I am familiar with using the 'date' command to get the current date but I have a situation where I need to get the previous day's date as well as the date two days prior. Theoretically I could use 'expr' to compute these values but I need it to work in instances where the previous month's dates... (2 Replies)
Hello,
I wanted to display the month for previous day date. Like, today date is 18-Nov-2008. So the previous date is 17-Nov-2008. The output should be November.
If the today date is 1-DEC-2008, then output should be NOVEMBER.
If the today date is 1-JAN-2008, then output should be DECEMBER.... (4 Replies)
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)
Hi guys,
I had a scenario...
1. I had to get the previous days date in yyyymmdd format
2. i had to create a file with Date inthe format yyyymmdd.txt format
both are different
thanks guys in advance.. (4 Replies)
Hi,
I would like to write a script that checks if a file ('counter') was modified the previous day, if so erase its contents and write 00000000 into it.
For e.g. if the file 'counter' was last modified at 11.30pm on 24th May and the script runs at 12.15am of 25th May, it should erase it's... (1 Reply)
Hi All,
I have a requirement where I need to first capture the current day & move all the files from a particular directory based on a previous day.
i.e move all the files from one directory to another based on current day & a previous day. Here is what I am trying, but it gives me errors.... (2 Replies)
Hi Experts,
i am using the below code get the date of previous day.
#!/usr/bin/ksh
datestamp=`date '+%Y%m%d'`
yest=$((datestamp -1))
echo $yest
When i execute the code i am getting output as:
20130715
What i am trying here is, based on the date passed i am fetching previus day's... (0 Replies)
Legends,
i need to get previous day using date command.
Can you please help.
sdosanjh:/home> date +%m%d%y
011514
i tried -d '-1 day' but it is not working (5 Replies)
Discussion started by: sdosanjh
5 Replies
LEARN ABOUT PHP
gmmktime
GMMKTIME(3) 1 GMMKTIME(3)gmmktime - Get Unix timestamp for a GMT dateSYNOPSIS
int gmmktime ([int $hour = gmdate("H")], [int $minute = gmdate("i")], [int $second = gmdate("s")], [int $month = gmdate("n")], [int
$day = gmdate("j")], [int $year = gmdate("Y")], [int $is_dst = -1])
DESCRIPTION
Identical to mktime(3) except the passed parameters represents a GMT date. gmmktime(3) internally uses mktime(3) so only times valid in
derived local time can be used.
Like mktime(3), arguments may be left out in order from right to left, with any omitted arguments being set to the current corresponding
GMT value.
PARAMETERS
o $hour
- The number of the hour relative to the start of the day determined by $month, $day and $year. Negative values reference the hour
before midnight of the day in question. Values greater than 23 reference the appropriate hour in the following day(s).
o $minute
- The number of the minute relative to the start of the $hour. Negative values reference the minute in the previous hour. Values
greater than 59 reference the appropriate minute in the following hour(s).
o $second
- The number of seconds relative to the start of the $minute. Negative values reference the second in the previous minute. Values
greater than 59 reference the appropriate second in the following minute(s).
o $month
- The number of the month relative to the end of the previous year. Values 1 to 12 reference the normal calendar months of the
year in question. Values less than 1 (including negative values) reference the months in the previous year in reverse order, so 0
is December, -1 is November, etc. Values greater than 12 reference the appropriate month in the following year(s).
o $day
- The number of the day relative to the end of the previous month. Values 1 to 28, 29, 30 or 31 (depending upon the month) refer-
ence the normal days in the relevant month. Values less than 1 (including negative values) reference the days in the previous
month, so 0 is the last day of the previous month, -1 is the day before that, etc. Values greater than the number of days in the
relevant month reference the appropriate day in the following month(s).
o $year
- The year
o $is_dst
- Parameters always represent a GMT date so $is_dst doesn't influence the result.
Note
This parameter has been removed in PHP 7.0.0.
RETURN VALUES
Returns a integer Unix timestamp.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 7.0.0 | |
| | |
| | $is_dst parameter has been removed. |
| | |
| 5.1.0 | |
| | |
| | As of PHP 5.1.0, the $is_dst parameter became |
| | deprecated. As a result, the new timezone han- |
| | dling features should be used instead. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
gmmktime(3) basic example
<?php
// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", gmmktime(0, 0, 0, 7, 1, 2000));
?>
SEE ALSO mktime(3), date(3), time(3).
PHP Documentation Group GMMKTIME(3)