how can i modify it so this date outputs the date in the form of the date of the messages file. for example:
As it is right now, the perl script outputs the date like this:
also, in the messages file, if the date of the current day is a single digit day (for example the 6th of september), it outputs the date like this:
notice there are two spaces between the month and the date.
how do i make the perl script do both of these? and by both of these i mean the (shortening of the month name, and the insertion of two spaces between the month and day IF the day of the month is single digit).
Hey all,
I have a shell that invokes a AWK.
In this AWK i want invoke a function that receives 3 parameters:
date: 20080831
time: 235901
duration: 00023
that function receive this 3 parameters and sum to this value two more seconds:
2008083123590100025
Remember that in case that... (3 Replies)
AIX 4.2
I am trying to do an rsh grep to search for date records inside server logs by doing this :
xx=`date +"%a %b %d"`
rsh xxx grep "^$XX" zzz
gives :
grep: 0652-033 Cannot open Jun.
grep: 0652-033 Cannot open 11.
But if I do :
xx=`date +"%a %b %d"`
grep "^$XX" zzz
it works... (2 Replies)
I have, a file wich list file on server ftp and i want to sort the file text as the command "ls -t"
i.e
drwxr-x--- 2 ftp_mont System 0 Sep 30 09:16 .
drwxr-x--- 2 ftp_mont System 0 Jul 15 2009 ..
-rwxr-x--- 1 ftp_mont System 343998791 Sep 01 09:20 manif... (14 Replies)
Hello,
My input files are having header/body/footer. The first three digits finds whether the data is header/body/footer. For example,
010AAAAA 20100507 234KB BBBBBBBBBB_20100506.DAT
020CCCCC DDDDDDDDD 373983983 19750426 456.90 ... (1 Reply)
Its very critical and 'm in need to schedule this on my crontab so that the output can be monitored by a tool
I have written the command below to redirect the error which has the output redirected to the file gincle_lol.log.
echo "---" >>/gingle/gincle_lol.log
date... (1 Reply)
Hello Team ,
I have to extract date section from the below file output. The output of the file is as shown below.
I have to extract the "" this section from the above output of the file. can anyone please let me know how can we acheive this? (4 Replies)
Hi,
I have line in input file as below:
3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL
My expected output for line in the file must be :
"1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL"
Can someone... (7 Replies)
Hello experts!
I need your help please
I have a file.txt of which I want to extract 3rd and 4th columns with date with the form e.g.:
2016-11-25 03:14:50and pass them to "date" command, but also append the 9th column in a file as well.
So I want to execute
date -d '2016-11-25 03:14:50' ... (2 Replies)
Hi all,
First post here. Working on Solaris 10, on a Sun t4-4, need to change RX queue depth(ethernet, not HBA) and was wondering if i could get by with just restarting the network or if i should just bounce the whole shebang.
Apologies if i missed a similar thread. if there is one, please... (2 Replies)
Hello.
System : opensuse leap 42.3
I have a bash script that build a text file.
I would like the last command doing :
print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt
where :
print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
LEARN ABOUT DEBIAN
data::faker::datetime
Data::Faker::DateTime(3pm) User Contributed Perl Documentation Data::Faker::DateTime(3pm)NAME
Data::Faker::DateTime - Data::Faker plugin
SYNOPSIS AND USAGE
See Data::Faker
DATA PROVIDERS
unixtime
Return a unix time (seconds since the epoch) for a random time between the epoch and now.
date
Return a random date as a string, using a random date format (see date_format).
time
Return a random time as a string, using a random time format (see time_format).
rfc822
Return an RFC 822 formatted random date. This method may not work on systems using a non-GNU strftime implementation (kindly let me
know if that is the case.)
ampm
Returns am or pm randomly (in the current locale) using one of the formats specified in ampm_format.
time_format
Return a random time format.
date_format
Return a random date format.
ampm_format
Return a random am/pm format.
datetime_format
Return a random date and time format.
month
Return a random month name, unabbreviated, in the current locale.
month_abbr
Return a random month name, abbreviated, in the current locale.
weekday
Return a random weekday name, unabbreviated, in the current locale.
weekday_abbr
Return a random weekday name, abbreviated, in the current locale.
sqldate
Return a random date in the ISO8601 format commonly used by SQL servers (YYYY-MM-DD).
datetime_locale
Return a datetime string in the preferred date representation for the current locale, for a random date.
date_locale
Return a date string in the preferred date representation for the current locale, for a random date.
time_locale
Return a time string in the preferred date representation for the current locale, for a random date.
century
Return a random century number.
dayofmonth
Return a random day of the month.
UTILITY METHODS
Data::Faker::DateTime::timestr($format);
Given a strftime format specifier, this method passes it through to POSIX::strftime along with a random date to display in that format.
Perl passes this through to the strftime function of your system library, so it is possible that some of the formatting tokens used
here will not work on your system.
NOTES AND CAVEATS
Be careful build timestamps from pieces
Be very careful about building date/time representations in formats that are not already listed here. For example if you wanted to get
a date that consists of just the month and day, you should NOT do this:
my $faker = Data::Faker->new();
print join(' ',$faker->month,$faker->dayofmonth)."
";
This is bad because you might end up with 'February 31' for example. Instead you should use the timestr utility function to provide
you a formatted time for a valid date, or better still, write a plugin function that does it:
my $faker = Data::Faker->new();
print $faker->my_short_date()."
";
package Data::Faker::MyExtras;
use base qw(Data::Faker);
use Data::Faker::DateTime;
__PACKAGE__->register_plugin(
my_short_date => sub { Data::Faker::DateTime::timestr('%M %e') },
);
POSIX::strftime
See the documentation above regarding the timestr utility method for some caveats related to strftime and your system library.
SEE ALSO
Data::Faker
AUTHOR
Jason Kohles, <email@jasonkohles.com>
COPYRIGHT AND LICENSE
Copyright 2004-2005 by Jason Kohles
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
perl v5.10.1 2005-07-14 Data::Faker::DateTime(3pm)