is there any function like php's strtotime() in csharp?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • snehil
    New Member
    • Jun 2009
    • 19

    #1

    is there any function like php's strtotime() in csharp?

    php have this very nice function
    strtotime()

    int strtotime ( string $time [, int $now ] )
    The function expects to be given a string containing an English date format and will try to parse that format into a Unix timestamp (the number of seconds since January 1 1970 00:00:00 UTC), relative to the timestamp given in now, or the current time if now is not supplied.

    http://php.net/manual/en/function.strtot ime.php

    i was wondering if we have any similar function in csharp also?
  • Christian Binder
    Recognized Expert New Member
    • Jan 2008
    • 218

    #2
    Look at Datetime.Parse( )

    Comment

    • Plater
      Recognized Expert Expert
      • Apr 2007
      • 7872

      #3
      I recomend DateTime.TryPar seExact()
      It is a bit more confusing, but has a lot more power

      Comment

      Working...