Clock.LocalTime Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets a Date
object that contains the current local date and time on this computer.
public:
property DateTime LocalTime { DateTime get(); };
public DateTime LocalTime { get; }
member this.LocalTime : DateTime
Public ReadOnly Property LocalTime As DateTime
Property Value
A Date
object that contains the current local date and time.
Examples
This example uses the My.Computer.Clock.LocalTime
property to display the local time of the computer on which the code runs.
MsgBox("Current local time: " & My.Computer.Clock.LocalTime)
Remarks
The My.Computer.Clock.LocalTime
property has the same behavior as the DateTime.Now property.
Availability by Project Type
Project type | Available |
---|---|
Windows Application | Yes |
Class Library | Yes |
Console Application | Yes |
Windows Control Library | Yes |
Web Control Library | Yes |
Windows Service | Yes |
Web Site | Yes |
Applies to
See also
ทํางานร่วมกับเราใน GitHub
แหล่งที่มาสำหรับเนื้อหานี้สามารถพบได้บน GitHub ซึ่งคุณยังสามารถสร้างและตรวจสอบปัญหาและคำขอดึงข้อมูลได้ สำหรับข้อมูลเพิ่มเติม ให้ดูคู่มือผู้สนับสนุนของเรา