Welcome to SPN

Register and Join the most happening forum of Sikh community & intellectuals from around the world.

Sign Up Now!
  1. Monthly (Recurring) Target: $300 :: Achieved: $95
      Become a Supporter    ::   Make a Contribution   

Converting time using CDate function

Discussion in 'Information Technology' started by pete2586, Jul 28, 2006.

  1. pete2586

    pete2586
    Expand Collapse
    Guest

    I'm trying to convert a string to a time using the CDate function. However, I
    can't get it to work. The date is in 24-hour format. Part of the code is
    shown below:

    timev = Hr & ":" & Min & ":00"
    rcs1(4) = timev

    Do I need to specify somehow that the time is in 24-hour format?

    Thanks
     
  2. Loading...

    Similar Threads Forum Date
    Jehovah's Witnesses Are Out And Converting! Blogs Jul 31, 2016
    Basic Questions about Converting to Sikhism Questions and Answers Nov 15, 2013
    Converting to Sikhism Hard Talk Aug 31, 2012
    Why are people converting to Sikhism? Sikh Sikhi Sikhism Jul 1, 2012
    Question About Converting To Sikhism For A Married Person Questions and Answers Jun 3, 2012

  3. Brendan Reynolds

    Brendan Reynolds
    Expand Collapse
    Guest

    Below are two examples, one using CDate, the other using TimeSerial. Using
    TimeSerial is probably the safer, less ambiguous option. See the help topic
    'TimeSerial Function' for more information.

    ? CDate("13:35")
    13:35:00

    ? TimeSerial(13,35,0)
    13:35:00

    If you are storing these values in a Date/Time field, don't forget that a
    Date/Time field always includes a complete date and time. As you are not
    specifying the date part, it will default to 30 December, 1899.

    --
    Brendan Reynolds
    Access MVP


    "pete2586" <pete2586@discussions.microsoft.com> wrote in message
    news:85797AB2-A4A9-4679-A87C-2CA735B4161A@microsoft.com...
    > I'm trying to convert a string to a time using the CDate function.
    > However, I
    > can't get it to work. The date is in 24-hour format. Part of the code is
    > shown below:
    >
    > timev = Hr & ":" & Min & ":00"
    > rcs1(4) = timev
    >
    > Do I need to specify somehow that the time is in 24-hour format?
    >
    > Thanks
     
Since you're here... we have a small favor to ask...

More people are visiting & reading SPN than ever but far fewer are paying to sustain it. Advertising revenues across the online media have fallen fast. So you can see why we need to ask for your help. Donating to SPN's is vote for free speech, for diversity of opinions, for the right of the people to stand up to religious bigotry. Without any affiliation to any organization, this constant struggle takes a lot of hard work to sustain as we entirely depend on the contributions of our esteemed writers/readers. We do it because we believe our perspective matters – because it might well be your perspective, too... Fund our efforts and together we can keep the world informed about the real Sikh Sikhi Sikhism. If everyone who writes or reads our content, who likes it, helps us to pay for it, our future would be much more secure. Every Contribution Matters, Contribute Generously!

    Become a Supporter      ::     Make a Contribution     



Share This Page