I need to incerement the date variable for instance
this produces
-I will grant this to : $Datehour and need to assign 1 hr from now to $Datelasthour
-the script time will be used to talk to DB system information.
however I need a second variable that is the exact same date + 1 hour
I need this for a script that will run between 9 am and 8 pm against a DB the time will be associated with the scheduling software and depends on business time thus I must use variables that pick system variable date and assign to a variable.
will update if my googing results in a answer, I feel like this is simple but yea any help would be awesome.
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)
Hi,
I have a perl script which prints epoch value of date in milliseconds as the output.
My reuirement is that once the output is printed,the day variable shld increment by 1 and when i execute the script for the second time the output shld be for the new day value.
My script looks as... (11 Replies)
Hi,
I have a variable lets say DATA_DATE.
I have to pass some value to this variable in YYYYMMDD format.
lets say today I have passed this variable as :
DATA_DATE=20100107
Then pls help me how to calculate another variable DATA_DATE1 (which is DATA_DATE+1).
The code should work... (3 Replies)
hi Friends,
Today_Dt=`date "+%Y-%m-%d"`
So the Today date is 2010-05-03
I have a file which has date values as below
2010-04-27
2010-04-02
2010-04-18
2010-04-28
2010-04-29
.. (1 Reply)
hi experts,
my requirement is like this i need to develop a shell script to update date part with new incremental date time in file some 'X' which is kept at some server location incrementing every two hours.as i am new to this scripting i need support from u people,thanx in advance (1 Reply)
Hi all,
I need to increment date at run time.
Example:
I need to write a shell script with two parameters.
1. country code like (US,UK, IND.....)
2. Date range from_date to to_date (20070101 to 20070331)
I need to run shell script like this
country_info.sh US 20070101 20070331
... (3 Replies)
Hi All,
I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Hi,
I have parameter file wo_location.prm which has a date variable $last_upd_date= 02032016.
I need to write a unix shell script to find that variable and increment it by 1 day.
The path to the file is root/dir_lc/shared/param/wo_location.prm and the variable is $last_upd_date.
Any... (2 Replies)
hi all,
i would like to increment the date variable i am using
for((i=20190731;i<=20190801;i++))
do
done
after 20190731 it should be 20190801 but this taking as 20190732,20190733....
kindly help me to solve this (3 Replies)
Discussion started by: prathaban
3 Replies
LEARN ABOUT PHP
datetime.format
DATETIME.FORMAT(3) 1 DATETIME.FORMAT(3)DateTime::format - Returns date formatted according to given format
Object oriented style
SYNOPSIS
public string DateTime::format (string $format)
DESCRIPTION
string DateTimeImmutable::format (string $format) string DateTimeInterface::format (string $format)
Procedural style
string date_format (DateTimeInterface $object, string $format)
Returns date formatted according to given format.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3)
o $format
- Format accepted by date(3).
RETURN VALUES
Returns the formatted date string on success or FALSE on failure.
EXAMPLES
Example #1
DateTime.format(3) example
Object oriented style
<?php
$date = new DateTime('2000-01-01');
echo $date->format('Y-m-d H:i:s');
?>
Procedural style
<?php
$date = date_create('2000-01-01');
echo date_format($date, 'Y-m-d H:i:s');
?>
The above example will output:
2000-01-01 00:00:00
NOTES
This method does not use locales. All output is in English.
SEE ALSO date(3).
PHP Documentation Group DATETIME.FORMAT(3)