Results 1 to 6 of 6

Thread: [RESOLVED] [2003] Getting the right Date

  1. #1

    Thread Starter
    Lively Member therat324's Avatar
    Join Date
    Oct 2008
    Location
    Bethany, Oklahoma
    Posts
    94

    Resolved [RESOLVED] [2003] Getting the right Date

    In the program im working on, it has a time trial version. Right now I have the program pulling the system date into a variable and checking it with a date file it creates when it is first used.

    The only problem with this is all the user would have to do when the time trial ran out is set the date on the computer back. Is there a way to pull a date into a variable that can not be changed by the user?
    My car if Chevy was VB.NET

    Code:
    Public Class MyCar
        Public Sub Camaro()
            Dim Camaro As Car
            Camaro = SS.Fast("Sexy")
        End Sub
    
        Public Function Fast(ByVal sexy As String ) As String
            Return "SUPER" & sexy
        End Function
    End Class

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

    Re: [2003] Getting the right Date

    You could get the date from a time server on the Web, as long as you don't mind enforcing an Internet connection every time your app is run.

    The only other way to cope with this is to record the time each time the app exits, then compare the current time to that when it starts up. It doesn't guarantee that the user won't turn their clock back but it does guarantee that it always goes forward for each run so the time will eventually run out. The user could always just increment the time by a few seconds each time they run the app but doing that would be a real pain so someone would have to be very determined to bother.

    The other issue is where you store this information so the user can't edit or delete it.
    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

  3. #3

    Thread Starter
    Lively Member therat324's Avatar
    Join Date
    Oct 2008
    Location
    Bethany, Oklahoma
    Posts
    94

    Re: [2003] Getting the right Date

    Okay, so how would I get the date off a date and time server?
    BTW sorry if you guys are tired of seeing me post questions. Still learning ;-D
    My car if Chevy was VB.NET

    Code:
    Public Class MyCar
        Public Sub Camaro()
            Dim Camaro As Car
            Camaro = SS.Fast("Sexy")
        End Sub
    
        Public Function Fast(ByVal sexy As String ) As String
            Return "SUPER" & sexy
        End Function
    End Class

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

    Re: [2003] Getting the right Date

    Never done it myself. I think it's a specific protocol but I'm not really sure.
    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

  5. #5

    Thread Starter
    Lively Member therat324's Avatar
    Join Date
    Oct 2008
    Location
    Bethany, Oklahoma
    Posts
    94

    Re: [2003] Getting the right Date

    ok thanks. Ill figure somthing out. To tell the truth I dont really like the idea of
    enforcing a connection everytime the program is run. Thanks
    My car if Chevy was VB.NET

    Code:
    Public Class MyCar
        Public Sub Camaro()
            Dim Camaro As Car
            Camaro = SS.Fast("Sexy")
        End Sub
    
        Public Function Fast(ByVal sexy As String ) As String
            Return "SUPER" & sexy
        End Function
    End Class

  6. #6
    Raging swede Atheist's Avatar
    Join Date
    Aug 2005
    Location
    Sweden
    Posts
    8,018

    Re: [2003] Getting the right Date

    Quote Originally Posted by jmcilhinney
    Never done it myself. I think it's a specific protocol but I'm not really sure.
    I'm not sure but the Network Time Protocol, NTP, could be whats needed here.
    http://support.ntp.org/bin/view/Serv..._A_Time_Server
    Rate posts that helped you. I do not reply to PM's with coding questions.
    How to Get Your Questions Answered
    Current project: tunaOS
    Me on.. BitBucket, Google Code, Github (pretty empty)

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