Sponsored Content
Top Forums Shell Programming and Scripting How to generate datetime string? Post 302534596 by buechler66 on Tuesday 28th of June 2011 08:49:01 AM
Old 06-28-2011
jayan_jay you rock. Thank you so much!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Generate a string

Hi, I want to generate a string like 99999 or 00000 depending upon the number of zeros or nines.. that is if I say 9 then I need the string "9" as 999999999. if I say 4 zeros then i need to get a string 0000. Like my input to a function are number ( 0,1,2) which should be there in the string and... (5 Replies)
Discussion started by: Tux_Raju
5 Replies

2. Shell Programming and Scripting

generate new string from a text file

Hi, I have a file and the content looks like this: line1 line2 File #5 : found '/u01/testing.txt' line5 line6 line7 File #12 : found '/u01/testabc.txt' line10 line11 I want to write a bash script to give me the output: The file 5 is '/u01/testing.txt' The file 12 is... (6 Replies)
Discussion started by: walterwaston
6 Replies

3. Programming

SQL datetime calculations

Suppose I have a table as follows: CREATE TABLE data ( `datetime` datetime DEFAULT NOT NULL, `temperature` float DEFAULT NO NULL ); populated with temperature samples of a couple times a second. Let's say I want to find the temperatures which are 1 second apart: SELECT D1.datetime,... (3 Replies)
Discussion started by: figaro
3 Replies

4. Shell Programming and Scripting

datetime.pm

Hi, I'm trying to use datetime.pm function in Perl. I do not have in the library. Is there a way to get it and put it into library? Thanks, George. (1 Reply)
Discussion started by: gpaulose
1 Replies

5. Shell Programming and Scripting

How to compare datetime?

Hi, To get the batch status, I will need to check if the particular job started after 5PM. if the job start time is before 5 pm, then it means that the job has not started for this particular date. I will run the script with date as argument. For eg: BS 07/10/2012 Start time from the log is... (8 Replies)
Discussion started by: ajayakunuri
8 Replies

6. Shell Programming and Scripting

Adding 48 hours to DateTime

Hey Guys, I have looked for a solution throughout the forum for my particular question, but I cant find one. So I'm sorry if I overlooked it. I need to be able to 48 add hours to a particular DateTime string. I have a variable named $startTime I would like to be able to take that... (1 Reply)
Discussion started by: chagan02
1 Replies

7. AIX

AIX DateTime Computation

Good day people, Kindly advice on below please. 1) Formatting/ Arithmetic operation of given date I understand from the AIX man date and some research that flag -d is not applicable for AIX shell scripting and some of the UNIX command date command is not available in AIX. Please advice... (1 Reply)
Discussion started by: cielle
1 Replies

8. UNIX for Dummies Questions & Answers

Find files between two datetime..

Hi All, How do i find all the files between two times. Eg: 26 may 2014 06:00 to 26 may 2014 14:00 mmin and mtime gives for a specific period. we receive hundreds of files input directories and i need to find how many files are received between given specific datetime. Thanks. (2 Replies)
Discussion started by: abhi_123
2 Replies

9. Shell Programming and Scripting

Filename with datetime

Hello All, I need unix command to generate a file with datetime in it. For example : ABC_YYYYMMDDHH24MISS.txt Regards Biswajeet Ghosh (1 Reply)
Discussion started by: bghosh
1 Replies

10. Shell Programming and Scripting

Generate a string of alphanumeric characters

Hi, I want a script of a code that will allow me to generate all possible combinations of alphanumberica characters of length 12 such that each string will contain numbers and either small or capital letters. For example a string may look like this: 123AB45cd678. (11 Replies)
Discussion started by: faizlo
11 Replies
DateTime::Format::ICal(3pm)				User Contributed Perl Documentation			       DateTime::Format::ICal(3pm)

NAME
DateTime::Format::ICal - Parse and format iCal datetime and duration strings SYNOPSIS
use DateTime::Format::ICal; my $dt = DateTime::Format::ICal->parse_datetime( '20030117T032900Z' ); my $dur = DateTime::Format::ICal->parse_duration( '+P3WT4H55S' ); # 20030117T032900Z DateTime::Format::ICal->format_datetime($dt); # +P3WT4H55S DateTime::Format::ICal->format_duration($dur); DESCRIPTION
This module understands the ICal date/time and duration formats, as defined in RFC 2445. It can be used to parse these formats in order to create the appropriate objects. METHODS
This class offers the following methods. o parse_datetime($string) Given an iCal datetime string, this method will return a new "DateTime" object. If given an improperly formatted string, this method may die. o parse_duration($string) Given an iCal duration string, this method will return a new "DateTime::Duration" object. If given an improperly formatted string, this method may die. o parse_period($string) Given an iCal period string, this method will return a new "DateTime::Span" object. If given an improperly formatted string, this method may die. o parse_recurrence( recurrence => $string, ... ) Given an iCal recurrence description, this method uses "DateTime::Event::ICal" to create a "DateTime::Set" object representing that recurrence. Any parameters given to this method beside "recurrence" will be passed directly to the "DateTime::Event::ICal->recur" method. If given an improperly formatted string, this method may die. This method accepts optional parameters "dtstart" and "dtend". These parameters must be "DateTime" objects. The iCal spec requires that "dtstart" always be included in the recurrence set, unless this is an "exrule" statement. Since we don't know what kind of statement is being parsed, we do not include "dtstart" in the recurrence set. o format_datetime($datetime) Given a "DateTime" object, this methods returns an iCal datetime string. The iCal spec requires that datetimes be formatted either as floating times (no time zone), UTC (with a 'Z' suffix) or with a time zone id at the beginning ('TZID=America/Chicago;...'). If this method is asked to format a "DateTime" object that has an offset-only time zone, then the object will be converted to the UTC time zone internally before formatting. For example, this code: my $dt = DateTime->new( year => 1900, hour => 15, time_zone => '-0100' ); print $ical->format_datetime($dt); will print the string "19000101T160000Z". o format_duration($duration) Given a "DateTime::Duration" object, this methods returns an iCal duration string. The iCal standard does not allow for months or years in a duration, so if a duration for which "delta_months()" is not zero is given, then this method will die. o format_period($span) Given a "DateTime::Span" object, this methods returns an iCal period string, using the format "DateTime/DateTime". o format_period_with_duration($span) Given a "DateTime::Span" object, this methods returns an iCal period string, using the format "DateTime/Duration". o format_recurrence($arg [,$arg...] ) This method returns a list of strings containing ICal statements. In scalar context it returns a single string which may contain embedded newlines. The argument can be a "DateTime" list, a "DateTime::Span" list, a "DateTime::Set", or a "DateTime::SpanSet". ICal "DATE" values are not supported. Whenever a date value is found, a "DATE-TIME" is generated. If a recurrence has an associated "DTSTART" or "DTEND", those values must be formatted using "format_datetime()". The "format_recurrence()" method will not do this for you. If a "union" or "complement" of recurrences is being formatted, they are assumed to have the same "DTSTART" value. Only "union" and "complement" operations are supported for recurrences. This is a limitation of the ICal specification. If given a set it cannot format, this method may die. Only "DateTime::Set::ICal" objects are formattable. A set may change class after some set operations: $recurrence = $recurrence->union( $dt_set ); # Ok - $recurrence still is a DT::Set::ICal $recurrence = $dt_set->union( $recurrence ); # Not Ok! - $recurrence is a DT::Set now The only unbounded recurrences currently supported are the ones generated by the "DateTime::Event::ICal" module. You can add ICal formatting support to a custom recurrence by using the "DateTime::Set::ICal" module: $custom_recurrence = DateTime::Set::ICal->from_recurrence ( recurrence => sub { $_[0]->truncate( to => 'month' )->add( months => 1 ) } ); $custom_recurrence->set_ical( include => [ 'FREQ=MONTHLY' ] ); SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHORS
Dave Rolsky <autarch@urth.org> and Flavio Soibelmann Glock <fglock@pucrs.br> Some of the code in this module comes from Rich Bowen's "Date::ICal" module. COPYRIGHT
Copyright (c) 2003 David Rolsky. 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 license can be found in the LICENSE file included with this module. SEE ALSO
datetime@perl.org mailing list http://datetime.perl.org/ perl v5.10.0 2009-05-24 DateTime::Format::ICal(3pm)
All times are GMT -4. The time now is 06:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy