Coding

    Share
    avatar
    Dio
    Quality Guy
    Quality Guy

    Number of posts : 3606
    Age : 27
    Location : Scotland
    Registration date : 2008-07-21

    Roleplay
    Guild: Goldengate
    Class: Profiteer
    Disposition: Jerkass

    Coding

    Post  Dio on Wed Oct 29, 2008 4:35 am

    Oi, How do I use a DATE data type in Visual Basic,
    Anyone know? <.<;;

    Guest
    Guest

    Re: Coding

    Post  Guest on Wed Oct 29, 2008 4:48 am

    Format Requirements

    You must enclose a Date literal within number signs (# #). You must specify the date value in the format M/d/yyyy, for example #5/31/1993#. This requirement is independent of your locale and your computer's date and time format settings.

    The reason for this restriction is that the meaning of your code should never change depending on the locale in which your application is running. Suppose you hard-code a Date literal of #3/4/1998# and intend it to mean March 4, 1998. In a locale that uses mm/dd/yyyy, 3/4/1998 compiles as you intend. But suppose you deploy your application in many countries. In a locale that uses dd/mm/yyyy, your hard-coded literal would compile to April 3, 1998. In a locale that uses yyyy/mm/dd, the literal would be invalid (April 1998, 0003) and cause a compiler error.


    MsgBox("The formatted date is " & Format(#5/31/1993#, "dddd, d MMM yyyy"))

    Dim dateInMay As New System.DateTime(1993, 5, 31, 12, 14, 0)


    A variable or constant of the Date data type holds both the date and the time. The following example illustrates this.

    Dim someDateAndTime As Date = #8/13/2002 12:14 PM#
    avatar
    KingK
    Ninja Pervert
    Ninja Pervert

    Number of posts : 1276
    Age : 30
    Location : Secret
    Registration date : 2008-07-21

    Roleplay
    Guild: Sunrise
    Class: Spiritual Leader
    Disposition: Sarcastic

    Re: Coding

    Post  KingK on Wed Oct 29, 2008 5:32 am

    Dunno, I only use PHP.
    avatar
    mcmicken
    Bard
    Bard

    Number of posts : 1605
    Age : 27
    Location : Scottish Borders/Edinburgh
    Registration date : 2008-07-21

    Roleplay
    Guild:
    Class:
    Disposition:

    Re: Coding

    Post  mcmicken on Wed Oct 29, 2008 5:36 am

    I was just about to say what Ven said :P
    avatar
    Dio
    Quality Guy
    Quality Guy

    Number of posts : 3606
    Age : 27
    Location : Scotland
    Registration date : 2008-07-21

    Roleplay
    Guild: Goldengate
    Class: Profiteer
    Disposition: Jerkass

    Re: Coding

    Post  Dio on Wed Oct 29, 2008 9:30 am

    Yeah,

    dim X as Date
    X = #DD,MM,YYYY#

    Guest
    Guest

    Re: Coding

    Post  Guest on Thu Oct 30, 2008 2:49 pm

    I like lightning it is fun and scary.

    Sponsored content

    Re: Coding

    Post  Sponsored content


      Current date/time is Sun Feb 25, 2018 3:22 am