System Date

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mclueless
    New Member
    • Jan 2008
    • 56

    System Date

    Every time my VB program runs, i want it to fetch the date from system and use it in variouos forms. how do i do that?
  • debasisdas
    Recognized Expert Expert
    • Dec 2006
    • 8119

    #2
    Simply you can use DATE function.It returns the systemdate.

    Comment

    • QVeen72
      Recognized Expert Top Contributor
      • Oct 2006
      • 1445

      #3
      Originally posted by mclueless
      Every time my VB program runs, i want it to fetch the date from system and use it in variouos forms. how do i do that?
      Text1.Text = Date

      Regards
      Veena

      Comment

      • VACEPROGRAMER
        Banned
        New Member
        • Nov 2007
        • 167

        #4
        TextBox1.Text = DateString
        TextBox2.Text = TImeString


        Vace

        Comment

        • Killer42
          Recognized Expert Expert
          • Oct 2006
          • 8429

          #5
          Keep in mind that the specific syntax, and system variable name, may vary depending on what version of VB you're using. For instance, in VB6 I would normally use Now to return the current system date/time.

          Comment

          • VACEPROGRAMER
            Banned
            New Member
            • Nov 2007
            • 167

            #6
            Visual Basic 2003 and Visual Basic 2005

            Vace

            Comment

            • mclueless
              New Member
              • Jan 2008
              • 56

              #7
              But NOW gives the date in form of mm/dd/yy. what if i want it as dd/mm/yy???

              Comment

              • QVeen72
                Recognized Expert Top Contributor
                • Oct 2006
                • 1445

                #8
                Hi,

                Text1.Text = Format(Now, "dd/mm/yyyy")

                Regards
                Veena

                Comment

                • debasisdas
                  Recognized Expert Expert
                  • Dec 2006
                  • 8119

                  #9
                  Originally posted by mclueless
                  But NOW gives the date in form of mm/dd/yy. what if i want it as dd/mm/yy???
                  try to sue this Format(Date, "dd-mm-yy")

                  Comment

                  Working...