Sponsored Content
Full Discussion: Date format in Perl
Top Forums Shell Programming and Scripting Date format in Perl Post 302201756 by cbkihong on Tuesday 3rd of June 2008 05:26:54 AM
Old 06-03-2008
You may install Date::Format if you prefer a more flexible way of formatting dates.

Date::Format - Date formating subroutines - search.cpan.org
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to search a date format from a file an replace with a string in PERL

I am very new to Perl. I am struggling so hard to search a date (such as 10/09/2009, 10-09-2009) from a text file and replace with a string (say DATE) using Perl. Please help me out. Thanks in advance. Regds Doren (4 Replies)
Discussion started by: my_Perl
4 Replies

2. Shell Programming and Scripting

20090620231013 to date format i am using substr, any simple way in perl?

Hi Everyone, $tmp="20090620231013"; $tmp = substr($tmp,0,8)." ".substr($tmp,8,2).":".substr($tmp,10,2).":".substr($tmp,12,2); So my output is: 20090620 23:10:13. I only can think substr is easy, any perl can do this just one line very simple efficient one? :eek: Thanks (3 Replies)
Discussion started by: jimmy_y
3 Replies

3. UNIX for Dummies Questions & Answers

perl yesterday's date in mmddyyyy format

Hi, Below command is producing yesaterday's date in mmddyy format - perl -e '@T=localtime(time-86400);printf("%02d%02d%02d",$T+1,$T,($T+1900)%100)' But i want the date in mmddyyyy format; plz help. Thankx, Rahul Bahulekar. ---------- Post updated at 05:13 AM ---------- Previous... (1 Reply)
Discussion started by: rahulbahulekar
1 Replies

4. Shell Programming and Scripting

perl regular expression format date

Hi Everyone, Mon 18 Jan 2010 09:52:10 AM MYT the output is 20100118 09:52:10 how to do it in perl regular expression =~ Thanks (3 Replies)
Discussion started by: jimmy_y
3 Replies

5. Programming

Basic perl code- Date format

Hi friends, Please see the below code carefully. ======================================================= # Get batch date and Ord range open OR,$ARGV; while (<OR>) { # find the batch date next if length $_ < 3; # BLANK LINE # last if $. > 120; # sample should be good enough... (2 Replies)
Discussion started by: pspriyanka
2 Replies

6. Shell Programming and Scripting

Different types of Date format in perl

I want to know the different types of date format possible in perl. Eg: yyyymmdd, yymmdd etc...Is there any format like YMD? Where can i find the list of all possibilites? Thanks in advance (1 Reply)
Discussion started by: irudayaraj
1 Replies

7. Shell Programming and Scripting

Date format check and replace string in PERL

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)
Discussion started by: irudayaraj
10 Replies

8. Shell Programming and Scripting

PERL : hhmiss - Date format check and replace

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)
Discussion started by: irudayaraj
3 Replies

9. Shell Programming and Scripting

Validating date in yyyymmdd format using PERL

Hi all, i had a code where in user will enter a date in yyyymmdd format.. i didnt use any validation for the date and now the problem is if a user enters date instead of month after year it is proceeding with the code.. like if the date is 20120426 and if the user enters 20122604 it... (4 Replies)
Discussion started by: smarty86
4 Replies

10. Shell Programming and Scripting

perl one-liner to get yesterday's date in format dd-MMM-yy (i.e. 01-JAN-12)

I have the following perl one-liner to get yesterday's date, but I would like it in the form of dd-MMM-yy (for example: 01-JAN-12). Can someone alter the below code so I get the format I want? Also, could someone also give me a line for dd-Mmm-yy (for example 01-Jan-12)? Code: YEST=`perl -w... (3 Replies)
Discussion started by: thibodc
3 Replies
Date::Language::Bulgarian(3)				User Contributed Perl Documentation			      Date::Language::Bulgarian(3)

NAME
Date::Language::Bulgarian - localization for Date::Format DESCRIPTION
This is Bulgarian localization for Date::Format. It is important to note that this module source code is in utf8. All strings which it outputs are in utf8, so it is safe to use it currently only with English. You are left alone to try and convert the output when using different Date::Language::* in the same application. This should be addresed in the future. SYNOPSIS
use strict; use warnings; use Date::Language; local $=$/; my $template ='%a %b %e %T %Y (%Y-%m-%d %H:%M:%S)'; my $time=1290883821; #or just use time(); my @lt = localtime($time); my %languages = qw(English GMT German EEST Bulgarian EET); binmode(select,':utf8'); foreach my $l(keys %languages){ my $lang = Date::Language->new($l); my $zone = $languages{$l}; print $/. "$l $zone"; print $lang->time2str($template, $time); print $lang->time2str($template, $time, $zone); print $lang->strftime($template, @lt); } AUTHOR
Krasimir Berov (berov@cpan.org) COPYRIGHT
Copyright (c) 2010 Krasimir Berov. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.18.2 2010-12-14 Date::Language::Bulgarian(3)
All times are GMT -4. The time now is 05:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy