C++ function for comparing two date strings...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • ad

    #1

    C++ function for comparing two date strings...

    I'm trying to compare two dates (mm/dd/yyyy) and get their differences
    by mm, dd and yyyy separated. Is there a c++ function library I can
    use? or do I need to parse each string individually and then change it
    to int like old days?
    Do appreciate if someone shines a light to my problem...
    AD

  • Victor Bazarov

    #2
    Re: C++ function for comparing two date strings...

    ad wrote:[color=blue]
    > I'm trying to compare two dates (mm/dd/yyyy) and get their differences
    > by mm, dd and yyyy separated. Is there a c++ function library I can
    > use? or do I need to parse each string individually and then change it
    > to int like old days?[/color]

    There are conversion functions (see <locale> header, 'std::time_get'
    class template). If your time fits into one of the supported formats,
    you won't need to reimplement the conversion.

    V

    Comment

    Working...