Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

datetime::format::mysql(3pm) [debian man page]

DateTime::Format::MySQL(3pm)				User Contributed Perl Documentation			      DateTime::Format::MySQL(3pm)

NAME
DateTime::Format::MySQL - Parse and format MySQL dates and times SYNOPSIS
use DateTime::Format::MySQL; my $dt = DateTime::Format::MySQL->parse_datetime( '2003-01-16 23:12:01' ); # 2003-01-16 23:12:01 DateTime::Format::MySQL->format_datetime($dt); DESCRIPTION
This module understands the formats used by MySQL for its DATE, DATETIME, TIME, and TIMESTAMP data types. It can be used to parse these formats in order to create DateTime objects, and it can take a DateTime object and produce a string representing it in the MySQL format. METHODS
This class offers the following methods. All of the parsing methods set the returned DateTime object's time zone to the floating time zone, because MySQL does not provide time zone information. * parse_datetime($string) * parse_date($string) * parse_timestamp($string) Given a value of the appropriate type, this method will return a new "DateTime" object. The time zone for this object will always be the floating time zone, because by MySQL stores the local datetime, not UTC. If given an improperly formatted string, this method may die. * format_date($datetime) * format_time($datetime) * format_datetime($datetime) Given a "DateTime" object, this methods returns an appropriately formatted string. SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHOR
Dave Rolsky <autarch@urth.org> 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.8.8 2006-10-23 DateTime::Format::MySQL(3pm)

Check Out this Related Man Page

DateTime::Format::Epoch::Lilian(3pm)			User Contributed Perl Documentation		      DateTime::Format::Epoch::Lilian(3pm)

NAME
DateTime::Format::Epoch::Lilian - Convert DateTimes to/from Lilian Days SYNOPSIS
use DateTime::Format::Epoch::Lilian; my $dt = DateTime::Format::Epoch::Lilian->parse_datetime( 53244.5 ); # 2004-08-27T00:00:00 DateTime::Format::Epoch::Lilian->format_datetime($dt); # 53244.5 my $formatter = DateTime::Format::Epoch::Lilian->new(); my $dt2 = $formatter->parse_datetime( 53244.5 ); # 2004-08-27T00:00:00 $formatter->format_datetime($dt2); # 53244.5 DESCRIPTION
This module can convert a DateTime object (or any object that can be converted to a DateTime object) to the Modified Julian Day number. See DateTime::Format::Epoch::JD for a description. METHODS
Most of the methods are the same as those in DateTime::Format::Epoch. The only difference is the constructor. o new() Constructor of the formatter/parser object. It has no parameters. SUPPORT
Support for this module is provided via the datetime@perl.org email list. See http://lists.perl.org/ for more details. AUTHOR
Eugene van der Pijll <pijll@gmx.net> COPYRIGHT
Copyright (c) 2004 Eugene van der Pijll. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. SEE ALSO
DateTime datetime@perl.org mailing list perl v5.10.1 2007-12-03 DateTime::Format::Epoch::Lilian(3pm)
Man Page

15 More Discussions You Might Find Interesting

1. Programming

Howto convert Ascii -> UTF-8 & back C++

While working with russian text under FreeBSD&MySQL I need to convert a string from MySQL to the Unicode format. I've just started my way in C++ under FreeBSD , so please explain me how can I get ascii code of Char variable and also how can i get a character into variable with the specified ascii... (3 Replies)
Discussion started by: macron
3 Replies

2. UNIX for Dummies Questions & Answers

What Setup?

Hopefully this post won't be too long :rolleyes: I've been in data processing for a number of years running on a windows system, and working with perl and MySQL to get the job done. I'm now part of a team who have bought a company and have been asked to investigate how we setup a new Data... (3 Replies)
Discussion started by: Kraythorne
3 Replies

3. Web Development

MySQL: Random offers for every airport

I need to write a MySQL query where it loops through every airport and generates 10 random offers (my offers table is 990,000+ rows) The code I have below works for 1 airport, but as soon as it gets bigger it slows RIGHT down. This is using PHP/MySQL At the moment it takes well over a... (2 Replies)
Discussion started by: worchyld
2 Replies

4. 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

5. UNIX for Advanced & Expert Users

Check latest time where theres the word 'processed' in logfile

Hi, Im doing a project to check the latest time with the word 'processed' in a logfile. the time range is within 2 hours before the curent datetime to present. For example: Current datetime is 'October 6 2009 8:00AM' --- HKT So the time range that need to check is from 'October 6... (1 Reply)
Discussion started by: romanne
1 Replies

6. 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

7. UNIX for Advanced & Expert Users

Rename a file to a file_current datetime in a shell script

Hi all, Could anyone suggest me on Renaming a file to a file_current datetime in a shell script. (3 Replies)
Discussion started by: Nithin
3 Replies

8. HP-UX

Compare dates

Hi, I want to convert two datetime fields to find out if the difference is one hour, in linux I've done this by converting both the datetime values to unix epoch time and subtracting them to find out if the difference is more than 3600s, however this does not work in hp-ux. I've these... (3 Replies)
Discussion started by: Random_Net
3 Replies

9. Programming

DATE & TIme

Can we select the datetime from oracle database in “hhmmssnnnccyymmdd” format ? please help to solve this..... (2 Replies)
Discussion started by: Sanal
2 Replies

10. Shell Programming and Scripting

How to generate datetime string?

Hi. I'm hoping there is a simple method where I'm able to generate a datetime string that looks like this (yyyymmddhhmm): 201106280830 The tricky part would be that I need this string to be today's datetime minus 1 year. Is there anyway to do this? (3 Replies)
Discussion started by: buechler66
3 Replies

11. Shell Programming and Scripting

perl modules installation

I have installed perl in windows. Now I would like to install spreadsheet::xlsx & DateTime::Format::Excel modules(also few more) at a time instead of installing them seperately. Could you please let me know how to install more than 1 module as a batch file in windows OS ? Thanks in... (5 Replies)
Discussion started by: giridhar276
5 Replies

12. Shell Programming and Scripting

SunOS compare datetime

Hi i need to compare the datetime between 2 columns. SunOS 5.1 is used. Notice that mktime seems like not supported. cat file2 P1,2012 12 4 21 36 48,2012 12 4 22 26 53 P2,2012 12 4 20 36 48,2012 12 4 21 21 23 P3,2012 12 4 18 36 48,2012 12 4 20 12 35 Below is the command used.... (1 Reply)
Discussion started by: chailee
1 Replies

13. Shell Programming and Scripting

Converting timestamp from PST to UTC

I need to convert the given datetime from PST to UTC, i gone through multiple forum examples but everywhere it mentioned about converting the server datetime. So could someone help me on this. I will be getting arguments for my script in the format of yyyymmddhh (eg:2015101004 - it will be pst),... (4 Replies)
Discussion started by: close2jay
4 Replies

14. 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

15. Shell Programming and Scripting

Perl - TimeDate format conversion

Dear All, I need to print the below value from excel column 20160219T05:21:59+0100 to 19-FEB-2016 05:21:11 Can anyone help on this datetime format conversion. Please suggest in print logic itself. Regards, Kumaresan P (6 Replies)
Discussion started by: Kumaresanpvk
6 Replies