Hello,
How do I convert unix timestamp value to 'normal' date format - to get year month and day values ?
Looks like it's easy to do using GNU date (linux systems). But how do I do tthis on AIX ?
I don't want to write C program, any ways to do that using unix shells ?
thanks (1 Reply)
Hi,
I'm working on a Informix4gl module. I'm just trying to find out any built-in function to fetch only the year/month from an INTERVAL YEAR TO MONTH data value.
Please let me know, if there are any functions to do this. If not, let me know for any alternative solutions to attain this.
... (5 Replies)
Hi
I have files like
abc_cd_20110302_123423
abc_cd_ef_20110301_123423
abc_cd_ef_20110403_123423
abc_ef_20110401_123423
I want to extract the
the year and month associated with each file.
I tried
logfileyearmonth=`echo $logfile | awk -F_'{print $NF}'`
Any other way can I... (6 Replies)
Can anyone help me in solving this ?
p=`date`
e=`echo $p | awk '{print $2,$3}'`
# echo $p
Wed Aug 4 12:00:08 IST 2013
but when I am echoing the value of e it is giving me with one space. As shown below:
# echo $e
Aug 4
I need this value to be exact as found in... (6 Replies)
Hi ,
Please excuse me for opening a new thread i am unable to find out the syntax error
in my if else condition inside for loop in awk command ,
my actual aim is to print formatted html td tag when if condition (True) having string as "failed",
could anyone please advise what is the right... (2 Replies)
Hi,
I am using ksh , when i try to use for loop i am getting the expected output.
$for variable in $(ps -fu user | grep -i something/ | grep -i something | grep -v grep | awk '{print $2}');do
> grep $variable /tmp/some_path/*/*
> done
when tried the below to remote server, getting... (4 Replies)
Discussion started by: karthikram
4 Replies
LEARN ABOUT PHP
datetime.settime
DATETIME.SETTIME(3) 1 DATETIME.SETTIME(3)DateTime::setTime - Sets the time
Object oriented style
SYNOPSIS
public DateTime DateTime::setTime (int $hour, int $minute, [int $second])
DESCRIPTION
Procedural style
DateTime date_time_set (DateTime $object, int $hour, int $minute, [int $second])
Resets the current time of the DateTime object to a different time.
PARAMETERS
o $object
-Procedural style only: A DateTime object returned by date_create(3). The function modifies this object.
o $hour
- Hour of the time.
o $minute
- Minute of the time.
o $second
- Second of the time.
RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure.
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.3.0 | |
| | |
| | Changed the return value on success from NULL to |
| | DateTime. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
DateTime.setTime(3) example
Object oriented style
<?php
$date = new DateTime('2001-01-01');
$date->setTime(14, 55);
echo $date->format('Y-m-d H:i:s') . "
";
$date->setTime(14, 55, 24);
echo $date->format('Y-m-d H:i:s') . "
";
?>
Procedural style
<?php
$date = date_create('2001-01-01');
date_time_set($date, 14, 55);
echo date_format($date, 'Y-m-d H:i:s') . "
";
date_time_set($date, 14, 55, 24);
echo date_format($date, 'Y-m-d H:i:s') . "
";
?>
The above examples will output something similar to:
2001-01-01 14:55:00
2001-01-01 14:55:24
Example #2
Values exceeding ranges are added to their parent values
<?php
$date = new DateTime('2001-01-01');
$date->setTime(14, 55, 24);
echo $date->format('Y-m-d H:i:s') . "
";
$date->setTime(14, 55, 65);
echo $date->format('Y-m-d H:i:s') . "
";
$date->setTime(14, 65, 24);
echo $date->format('Y-m-d H:i:s') . "
";
$date->setTime(25, 55, 24);
echo $date->format('Y-m-d H:i:s') . "
";
?>
The above example will output:
2001-01-01 14:55:24
2001-01-01 14:56:05
2001-01-01 15:05:24
2001-01-02 01:55:24
SEE ALSO DateTime.setDate(3), DateTime.setISODate(3).
PHP Documentation Group DATETIME.SETTIME(3)