10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
Good day.
I am trying to change the output on my date so that I can get the month as a numeric value.
TODAY=`perl -e 'print localtime(time()) . "\n" '`
Here are the results from the above perl statement
Thu Feb 11 13:16:40 2016
I am not sure of the syntax to get a date more like... (2 Replies)
Discussion started by: ziggy6
2 Replies
2. Shell Programming and Scripting
Hi
I have a shell variable storing DATE in YYYY-MM-DD format
is there a way i extract required field say only DD
Also, would be great if there is a way which could take date format as well so that code is generic for any date format eg DDMMYYYY or DD/MM/YYYY or YYYY/MM/DD etc.
Thanks (4 Replies)
Discussion started by: skyineyes
4 Replies
3. Emergency UNIX and Linux Support
can anyone one help me....to make date and time format...to following format for my file
Code:
DATE TIME DD- MON- YEAR 24 Hours I have a need of format like this
12-Jan-2012 in one column, then time in 24 Hours in another column....please help...me...
... (7 Replies)
Discussion started by: nex_asp
7 Replies
4. Shell Programming and Scripting
I needed some help in adding a duration (in seconds) to a start time (in hhmmss format) and a start date (in mmddyy format) in order to get an end date and end time. The concept of a leap year is also to be considered while incrementing the day. The code/ function that I have formed so far is as... (3 Replies)
Discussion started by: codehelp04
3 Replies
5. Shell Programming and Scripting
Hello All,
This is my first script in PERL. Hence require your help in moving further.
I have a script which should populate the values for Today, Yesterday output.
For which I use timeFrame as a variable to obtain the time in hrs:mm as 10:00.
All I want is, I want my timeFrame to start... (4 Replies)
Discussion started by: sathyaonnuix
4 Replies
6. UNIX for Dummies Questions & Answers
I'd like to convert a date string in the form of sun aug 19 09:03:10 EDT 2012, to unixtime timestamp using awk.
I tried
This is how each line of the file looks like, different date and time in this format
Sun Aug 19 08:33:45 EDT 2012, user1(108.6.217.236) all: test on the 17th
... (2 Replies)
Discussion started by: bkkid
2 Replies
7. Shell Programming and Scripting
my code:
$dateformat = yyyy_mm_dd
if($dateformat =~ m/yyyy/i)
{
print ("found");
$yyyy = strftime "%Y", localtime;
print ("year is $yyyy\n");
$dateformat =~ s/yyyy/$yyyy/;
print ("new date format is $dateformat\n");
}
elsif($dateformat =~ m/yy/i)
{
print ("found");
$yy = strftime "%y",... (4 Replies)
Discussion started by: irudayaraj
4 Replies
8. Shell Programming and Scripting
I have a perl script that automatically runs on Mondays.
I need to have it create a variable for last Monday's date thru that Sunday's date.
example: 04-01-2011 thru 04-08-2011
Its reporting numbers for the previous week beginning with Monday and ending on Sunday. So i dont have to go in... (7 Replies)
Discussion started by: bbraml
7 Replies
9. Shell Programming and Scripting
while read l
do
vTimeCreated=`perl -e '@d=localtime ((stat(shift))); printf "%02d-%02d-%04d %02d:% 02d:%02d\n", $d,$d+1,$d+1900,$d,$d,$d' ${l}`
echo "${l} || ${vTimeCreated}" >> ${fPrefx}_Output_Files_${vDate}.txt
done < servername.txt Using the above code to format date time for each of the... (0 Replies)
Discussion started by: HeadBang
0 Replies
10. Shell Programming and Scripting
Hi,
I want to get the current date and time and subtract 1 day to get to the
previous day?
I see timelocal( ) and (time) etc.
How do I code this in PERL to get the previous day?
Thanks
Nurani (2 Replies)
Discussion started by: nurani
2 Replies