09-04-2009
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hello all
im looking for fast way to convert timestamp format to date format
and vaiseversa in tcsh , can it be done?
thanks allot (2 Replies)
Discussion started by: umen
2 Replies
2. Shell Programming and Scripting
Dear Experts,
I need your help to convert a unix date and time format number in to readable format like dd/mm/yyyy .
I have a text file of more than 10,000 records and it is like
NAME DATE1 COUNTRY DATE2
ABD 1223580395699 USA 1223580395699... (3 Replies)
Discussion started by: shary
3 Replies
3. AIX
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)
Discussion started by: vilius
1 Replies
4. Shell Programming and Scripting
Dear Expert
How to convert date in format of YYYY-MM-DD HH:MM:SS to unix format
using a script or command if avaliable
Example
"2011-05-15 18:00:00" is converted to 1330970400
I tried to use option d in date command but no use, Im using solaris 10
Thanks a lot (12 Replies)
Discussion started by: yahyaaa
12 Replies
5. AIX
hello,
i have an AIX5.3 machine and i am writing a script to display some processes.
inside the script i want to get the time that the process starts and convert it to a unix timestamp.
is there a command that i can use to do that? i search the web but all i found is long scripts and it does... (4 Replies)
Discussion started by: omonoiatis9
4 Replies
6. Shell Programming and Scripting
Hi,
I am getting the below string as a input for date.
12/03/2013 11:02 AM
I want to change this date as 03-DEC-2013 11:02 AM.
Could you please help on this.
Thanks
Chelladurai (4 Replies)
Discussion started by: ckchelladurai
4 Replies
7. Shell Programming and Scripting
Hello I have a file : file1.txt with the below contents :
237176 test1 test2 1442149024
237138 test3 test4 1442121300
237171 test5 test7 1442112823
237145 test9 test10 1442109600
In the above file fourth field represents the timestamp in Unix format.
I found a command which converts... (6 Replies)
Discussion started by: rahul2662
6 Replies
8. Shell Programming and Scripting
Hello All,
I have a date in DD/MM/YYYY format. I am trying to convert this into unix timestamp. I have tried following:
date -d $mydate +%s
where mydate = 23/12/2016 00:00:00
I am getting following error:
date: extra operand `+%s'
Try `date --help' for more information.
... (1 Reply)
Discussion started by: angshuman
1 Replies
9. Shell Programming and Scripting
Hi All
I need help in converting a string of YYYYMMDD format to date in Sun OS and then find out if the day is a Wednesday or not. The "date -d" option is not working and your help is much appreciated.
The date command usage from the operating system we use here is as follows:
usage: ... (1 Reply)
Discussion started by: SK123
1 Replies
10. Solaris
Hi All
I need help in converting a string of YYYYMMDD format to date in Sun OS and then find out if the day is a Wednesday or not. The "date -d" option is not working and your help is much appreciated.
The date command usage from the operating system we use here is as follows:
Thanks,
SK (11 Replies)
Discussion started by: SK123
11 Replies
LEARN ABOUT PHP
date_sunrise
DATE_SUNRISE(3) 1 DATE_SUNRISE(3)
date_sunrise - Returns time of sunrise for a given day and location
SYNOPSIS
mixed date_sunrise (int $timestamp, [int $format = SUNFUNCS_RET_STRING], [float $latitude = ini_get("date.default_latitude")], [float
$longitude = ini_get("date.default_longitude")], [float $zenith = ini_get("date.sunrise_zenith")], [float $gmt_offset])
DESCRIPTION
date_sunrise(3) returns the sunrise time for a given day (specified as a $timestamp) and location.
PARAMETERS
o $timestamp
- The $timestamp of the day from which the sunrise time is taken.
o $format
-
$format constants
+-----------------------+-------------------------------------------+
| constant | |
| | |
| | description |
| | |
| | example |
| | |
+-----------------------+-------------------------------------------+
| SUNFUNCS_RET_STRING | |
| | |
| | returns the result as string |
| | |
| | 16:46 |
| | |
| SUNFUNCS_RET_DOUBLE | |
| | |
| | returns the result as float |
| | |
| | 16.78243132 |
| | |
|SUNFUNCS_RET_TIMESTAMP | |
| | |
| | returns the result as integer (timestamp) |
| | |
| | 1095034606 |
| | |
+-----------------------+-------------------------------------------+
o $latitude
- Defaults to North, pass in a negative value for South. See also: date.default_latitude
o $longitude
- Defaults to East, pass in a negative value for West. See also: date.default_longitude
o $zenith
- Default: date.sunrise_zenith
o $gmtoffset
- Specified in hours.
RETURN VALUES
Returns the sunrise time in a specified $format on success or FALSE on failure.
ERRORS
/EXCEPTIONS
Every call to a date/time function will generate a E_NOTICE if the time zone is not valid, and/or a E_STRICT or E_WARNING message if using
the system settings or the $TZ environment variable. See also date_default_timezone_set(3)
CHANGELOG
+--------+---------------------------------------------------+
|Version | |
| | |
| | Description |
| | |
+--------+---------------------------------------------------+
| 5.1.0 | |
| | |
| | Now issues the E_STRICT and E_NOTICE time zone |
| | errors. |
| | |
+--------+---------------------------------------------------+
EXAMPLES
Example #1
date_sunrise(3) example
<?php
/* calculate the sunrise time for Lisbon, Portugal
Latitude: 38.4 North
Longitude: 9 West
Zenith ~= 90
offset: +1 GMT
*/
echo date("D M d Y"). ', sunrise time : ' .date_sunrise(time(), SUNFUNCS_RET_STRING, 38.4, -9, 90, 1);
?>
The above example will output something similar to:
Mon Dec 20 2004, sunrise time : 08:54
SEE ALSO
date_sunset(3).
PHP Documentation Group DATE_SUNRISE(3)