Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Mocking time with SQLite

by Khen1950fx (Canon)
on Dec 26, 2010 at 12:56 UTC ( #879210=note: print w/ replies, xml ) Need Help??


in reply to Mocking time with SQLite

I tried DateTime::Format::SQLite. It'll parse a string into a format that SQLite understands. Note that SQLite uses UTC, so Test::MockTime may not be compatible with SQLite. Following the example from the SYNOPSIS:

#!/usr/bin/perl use strict; use warnings; use DateTime::Format::SQLite; my $dt = DateTime::Format::SQLite->parse_datetime( '2010-12-26 04:41:2 +0' ); print DateTime::Format::SQLite->format_datetime($dt), "\n";


Comment on Re: Mocking time with SQLite
Download Code
Re^2: Mocking time with SQLite
by jaldhar (Vicar) on Dec 26, 2010 at 13:21 UTC

    Sorry, I'm confused as to how DateTime::Format::SQlite (Which I am using btw just not in this test script) could help here. It converts SQLite date/time values to and from DateTime objects. My problem is the "wrong" value is in the database in the first place. I need to change SQLites notion of the current time.

    --
    જલધર

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://879210]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2014-09-23 06:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (210 votes), past polls