Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: DateTime parsing and midnight

by pokki (Monk)
on Nov 11, 2010 at 14:07 UTC ( #870858=note: print w/replies, xml ) Need Help??


in reply to Re: DateTime parsing and midnight
in thread DateTime parsing and midnight

I may not have made myself clear, but the time in the string is not a duration, it's part of a timestamp, e.g. "Meeting <2010-11-11 Thu 13:00>" means that a meeting is scheduled for November 11 at 13:00 (or 1 PM).

Replies are listed 'Best First'.
Re^3: DateTime parsing and midnight
by Corion (Pope) on Nov 11, 2010 at 14:10 UTC

    Yes. That is a point in time. But the other string is a duration, as it is meant for the whole day, isn't it?

    In any way, as you seem to want the two to be treated differently, you will have to do so.

      I finally got what you meant, sorry. I never thought of all-day events as having a duration, despite their name; on calendar applications they are usually marked once for the day, not as having a duration of 24 hours. The use case is more like "Foo's birthday" than "It will be Foo's birthday for 24 hours today", if you get my meaning.

      It all probably means I'll have to distinguish them by hand after all, before giving them to DateTime::Format::whatever.

      I was hoping there would be some way to recognize a DateTime object created with no time from a DateTime object created with 0:00 as the time. Well, if there ain't, there ain't.

      Thank you for your input!

        Ah - now I understand what these "whole day" entries are for. I think you will still need a marker for these entries, as they are special because they appear (at least on my phone calendar) without a duration bar. There is no way to distinguish a DateTime with a default time from a DateTime with a time portion of 0:00.

        Can you use duration = 0 seconds vs duration = undef? What about negative duration being a special case?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://870858]
help
Chatterbox?
[perldigious]: A question since I'm ignorant of what's normal for database management... Do admins change column names a lot in databases?
[perldigious]: On occasion my scripts break, because they will do something that seems laregly pointless to me... like in this case, changing a column name from "ABC Category" to "ABC Category Override".
[perldigious]: Being the ignorant one, my initial reaction to that is, "that's sort of a dick move, a lot of people like me expect column names like that to stay the same, why the hell would you change them like that for seemingly no good reason?"
[perldigious]: Or is my irritation/ frustration well founded?
[Corion]: perldigious: That seems to be more the export and likely it's the recipients of that export that like the titles changes
[Corion]: ... "changed"
[Corion]: I usually expect fixed header names, but am sometimes lenient in the order of columns. But changing the report titles often sounds to me as if you are not the sole consument of the export ;)

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (5)
As of 2017-05-25 13:31 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?