O'Reilly logo

VB.NET Language in a Nutshell, Second Edition by Steven Roman PhD, Paul Lomax, Ron Petrusha

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

DateString Property

Class

Microsoft.VisualBasic.DateAndTime

Syntax

DateString(  )

Return Value

A String representing the current system date

Description

Returns or sets a string representing the current system date in the format “mm-dd- yyyy”

Rules at a Glance

The allowed formats for setting the date are “m-d-yyyy,” “m-d-y,” “m/d/yyyy,” and “m/d/y.”

Programming Tips and Gotchas

  • To get or set the current system time as a String, use the TimeString property.

  • To access the current system date as a Date, use the Today property.

VB.NET/VB 6 Differences

The DateString property is new to VB.NET. It is a replacement for the VB 6 Date statement, which sets the system date, and the Date and Date$ functions, which retrieve the system date.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required