08-08-2013
Thank you for reporting back with the solution to your issue.
For future reference, adding a timezone abbreviation to the date format will never affect the output's timezone; it will only cause confusion if the abbreviation does not correspond to the actual timezone in use.
To use UTC, as Ygor demonstrated, you can use the --utc (or -u) option. For UTC or any other timezone, set the TZ environment variable appropriately. This can be done on a per command or login session.
Regards,
Alister
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to get previous date from date command. I am using ksh shell.
Exmp:
today is 2008.09.04
I want the result : 2008.09.03
Please help.
Thanks in advance. (4 Replies)
Discussion started by: rinku
4 Replies
2. Shell Programming and Scripting
Hi,
does anybody know how to format `date` command correctly to return the day of the week? Thanks -A
I work in ksh.... (1 Reply)
Discussion started by: aoussenko
1 Replies
3. Shell Programming and Scripting
foreach x ( *.foo)
echo "move file?"
set move=$<
if($move == y) then
echo "enter new pathname:"
set path=$<
mv $x $path/$x
endif
end
ok guys, im creating this script so i can move files with *.foo extensions and *.bar... (6 Replies)
Discussion started by: pantelis
6 Replies
4. Shell Programming and Scripting
Hi
I want to get tomorrow and yesterday date from date command. My shell is KSH and server is AIX. I tried several options, but unable to do. Please help on this.
Regards
Rajesh (5 Replies)
Discussion started by: rajeshmepco
5 Replies
5. UNIX for Advanced & Expert Users
Hello everyone,
I have a small problem that I'm stuck for several days and I do not go out.
I tell you, I have a php script that I want to run crontab, it uses a compiled bcompiler file.
In my php file
if(file_exists("php/Alibrary.phb")){
include_once("php/Alibrary.phb");
What I do... (6 Replies)
Discussion started by: nicolas33770
6 Replies
6. Shell Programming and Scripting
Hi all,
Need an urgent help on the below scenario.
script:
awk -F","
'BEGIN { #some variable assignment}
{ #some calculation and put values in array}
END {
year=#getting it from array and assume this will be 2014
month=#getting it from array and this will be 05
date=#... (7 Replies)
Discussion started by: vijaidhas
7 Replies
7. HP-UX
HI,
Can anyone tell me how to pull the date and file name separated by a space using the find command or any other command. I want to look through several directories and based on a date timeframe (find -mtime -7), output the file name (without the path) and the date(in format mmddyyyy) to a... (2 Replies)
Discussion started by: lnemitz
2 Replies
8. Shell Programming and Scripting
So as I write this today is two days after the clocks go back here in the UK. I have a script that worked last week. Yesterday it developed a bug. I eventually found the culprit is Gnu Date.
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 16.04.5 LTS... (10 Replies)
Discussion started by: apmcd47
10 Replies
9. HP-UX
current date command runs well
awk -v t="$(date +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
subtract 30 days fails
awk -v t="$(date --date="-30days" +%Y-%m-%d)" -F "'" '$1 < t' myname.dat
awk command in hp unix subtract 30 days automatically from current date without date illegal option error... (20 Replies)
Discussion started by: kmarcus
20 Replies
LEARN ABOUT CENTOS
__pmmktime
PMMKTIME(3) Library Functions Manual PMMKTIME(3)
NAME
__pmMktime - convert a tm structure to a calendar time
C SYNOPSIS
#include <time.h>
#include <pcp/pmapi.h>
#include <pcp/impl.h>
time_t *__pmMktime(struct tm *timeptr);
cc ... -lpcp
DESCRIPTION
__pmMktime is very similar to mktime(3), except the timezone used is the current ``reporting timezone'' (rather than the default TZ envi-
ronment variable scheme).
Like mktime(3) the time to be converted is passed via timeptr, and the function result contains the calendar time (the number of seconds
since 00:00:00 UTC, January 1, 1970).
The default current reporting timezone is as defined by the TZ environment variable, so __pmMktime and mktime(3) will initially produce
similar conversions.
Use pmNewZone(3), pmNewContextZone(3) or pmUseZone(3) to establish a new current reporting timezone that will effect __pmMktime but not
mktime(3).
SEE ALSO
mktime(3), PMAPI(3), pmCtime(3), pmLocaltime(3), pmNewContextZone(3), pmNewZone(3) and pmUseZone(3).
Performance Co-Pilot PCP PMMKTIME(3)