Results 1 to 4 of 4

Thread: Convert string to time

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Aug 2006
    Posts
    734

    Question Convert string to time

    Hi guys,
    using compact framework is there a way to convert a string, for example "12:30" to an actual time as i need to add a certain amount of minutes to a string value and then compare to another time?

    Thanks in advance for any help
    If your problem has been solved then please mark the thread [RESOLVED].
    If i have helped then please Rate my post

  2. #2
    Addicted Member Genom's Avatar
    Join Date
    May 2006
    Posts
    186

    Re: Convert string to time

    VB Code:
    1. mid("12:30",len("12:30")-2,2)
    will get minutes and you can get hour with this function
    VB Code:
    1. mid("12:30",1,2)
    and there should be a function in taht you enter hour minute and second and it converts them to time. then you can add minutes or what you want. After that you can compare...
    Dim Me As Coder

  3. #3
    Frenzied Member bmahler's Avatar
    Join Date
    Oct 2005
    Location
    Somewhere just west of the Atlantic
    Posts
    1,568

    Re: Convert string to time

    does the compact framework support CDate, or perhaps Date.Parse? I am not that familiar with it but I would assume that it does.
    Boooya
    • Visual Studio 2008 Professional
    • Don't forget to use [CODE]your code here[/CODE] when posting code
    • Don't forget to rate helpful posts!
    • If you're question was answered please mark your thread [Resolved]


    Code Contributions:
    PHP
    PHP Image Gallery v1.0PHP Image Gallery v2.0
    VB 2005
    Find Computers on a networkSimple License EncryptionSQL Server Database Access dllUse Reflection to Return Crystal ReportDocumentSilently Print PDFGeneric Xml Serailizer


    Useful Links: (more to come)
    MSDN (The first and foremost)MSDN Design Guidelines API Reference • Inno Setup CompilerInno Setup PreprocessorISTool - Fairly easy to use GUI for creating inno setup projects • Connection StringsNAnt -Automated BuildsCruise Control .NET - Frontend for automated builds

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,222

    Re: Convert string to time

    Time handling is perfromed using either the DateTime or TimeSpan types in .NET, depending on the situation. Looking at the MSDN topics for the member listing for each of those types we see that virtually all members are supported on the CF, including the Parse method.
    Last edited by jmcilhinney; Feb 6th, 2007 at 07:31 PM.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

Posting Permissions

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



Click Here to Expand Forum to Full Width