something like the following would work I guess:
POSIX::mktime does not do what the perldoc says it should do on my Perl.... please ignore previous version
Last edited by Skrynesaver; 09-17-2013 at 01:44 PM..
Reason: Remembered to load POSIX module
Hi All,
I am getting two input from User for Date from the command prompt when
my script is executed .
The date format i am taking is : DD-MM-YYYY
so is there any method in Unix to validate the two input date.
There might be many cases for these two date to be invalid.... (1 Reply)
Hi,
I have a date field in my input file.
I just want to check if its in the format "DD-MM-YYYY".
Is there any command which can achieve this?
Thanks and Regards,
Abhishek (2 Replies)
Hi Guru's,
Are there any simple method to check the date format which is in "YYDDD"
(ex: 08002 for 02-Jan-2008)?
Eventhough this can be implemented in several way's, I need the simpler one. Any idea would be much appreciated.
Thanks in advance,
Mysore Ganapati (4 Replies)
how to check input date format.
for example $input_date must be in format dd.mm.gg
script is execute like this:
bin/script1.sh 14.12.2009
script1.sh code:
#!/bin/sh
input_date=$1
CMD="/app/si/test/test.sh $input_date"
echo "*****"
$CMD (2 Replies)
My source file having one date column. The formate of the date column is yyyymm. I need to validate whether all the rows are in same format in the given file. If it is not I have captured that records in a separate file. I am very new to Unix. I don't how to achieve this. Plz help me to achieve... (2 Replies)
I have got few date format patterns like "yyyymmdd", "yy_mm_dd" etc.
There can be any combination of such patterns.
I have used add_delta_days to find "yyyy", "yy", "mm", "dd" for the current date and saved them to different variables like "$y1", "$y2", "$m1" etc
In one line, i want to... (10 Replies)
I have a filename,
This can be any of any format,
I want to check if the filename has hours,mins and seconds part. If it is present, i want to replace it with a " * " (star symbol)
output needed:
IMP: The time part can be in any pattern.
How can this be done?:confused:... (3 Replies)
hi there
I have file names in different format as below
triss_20111117_fxcb.csv
triss_fxcb_20111117.csv
xpnl_hypo_reu_miplvdone_11172011.csv
xpnl_hypo_reu_miplvdone_11-17-2011.csv
xpnl_hypo_reu_miplvdone_20111117.csv
xpnl_hypo_reu_miplvdone_20111117xfb.csv... (10 Replies)
Hi! how do i know if the input is the same as the required date format? the date should be dd/mm/YYYY ex. 2/3/2012 or 15/11/2012
all the following conditions must return an error:
*input of string
*day is > 31 or < 1
*month is > 12 or < 1
*year is < 2013
suppose the date format is stored... (1 Reply)
Record:
Record1|Record2|Record3|Record4|Record5|DATE1|DATE2
Need to Check DATE1 & DATE2 is in DDMMYYYY format in a file.
records which not meet the date format DDMMYYYY extract to other file. (1 Reply)
Discussion started by: vivekn
1 Replies
LEARN ABOUT CENTOS
datetime::format::dateparse
DateTime::Format::DateParse(3) User Contributed Perl Documentation DateTime::Format::DateParse(3)NAME
DateTime::Format::DateParse - Parses Date::Parse compatible formats
SYNOPSIS
use DateTime::Format::DateParse;
my $dt = DateTime::Format::DateParse->parse_datetime( $date );
my $dt = DateTime::Format::DateParse->parse_datetime( $date, $zone );
DESCRIPTION
This module is a compatibility wrapper around Date::Parse.
USAGE
Import Parameters
This module accepts no arguments to it's "import" method and exports no symbols.
Methods
Class Methods
o parse_datetime($date [, $zone])
Accepts a Date::Parse compatible $date string and optionally a Time::Zone compatible $zone string.
Returns a DateTime object.
GOTCHAS
o If parse_datetime is called on a $date that doesn't know specify a timezone and $zone is not set, then the timezone of the returned
DateTime object will be set to the "local" timezone. This is consistent with the behavior of Date::Parse.
o If parse_datetime is called without a $zone but the $date string does specify a timezone/offset or if parse_datetime is called with a
$zone that DateTime::TimeZone does not understand, the returned DateTime object will have it's timezone set to a fixed offset from UTC.
This means that "DST" information is not available and date math will not reflect "DST" transitions. This may be resolved for true
timezones by using the DateTime::TimeZone::Alias module to "alias" the Time::Zone timezone to an Olson DB name. This may be done
automatically in a future release.
CREDITS
Graham Barr (GBARR) <gbarr@pobox.com>, author of Date::Parse
Everyone at the DateTime "Asylum".
SUPPORT
Support for this module is provided via the <datetime@perl.org> email list. See <http://lists.perl.org/> for more details.
AUTHOR
Joshua Hoblitt (JHOBLITT) <jhoblitt@cpan.org>
COPYRIGHT
Copyright (c) 2005-6 Joshua Hoblitt. All rights reserved. This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.
The full text of the licenses can be found in the LICENSE file included with this module, or in perlartistic and perlgpl as supplied with
Perl 5.8.1 and later.
SEE ALSO
Date::Parse, Time::Zone, DateTime, DateTime::TimeZone, DateTime::TimeZone::Alias, <http://datetime.perl.org/>
perl v5.16.3 2014-06-10 DateTime::Format::DateParse(3)