Results 1 to 3 of 3

Thread: To obtain time part from a date?

  1. #1
    Join Date
    Jan 2005
    Location
    Pune
    Posts
    19

    To obtain time part from a date?

    Is there any other alternative for getting time part of a datetime type variable than using datepart()?

  2. #2
    Join Date
    Dec 2004
    Posts
    502
    What specifically do you want to get? If you want the entire time part, how about: CONVERT(varchar, getdate(), 108)

  3. #3
    Join Date
    Jan 2005
    Location
    Pune
    Posts
    19
    Yes, I wanted the same. Thanks for your help.
    As I need the miliseconds to, I'll use 114 instead of 108

    CONVERT(varchar, getdate(), 114).

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •