Date is a non primitive value stored in memory heap by using date constructor
The data type in typescript to store date value is defined with "any" type
The memory for date value is allocated by using dynamic memory allocation operator "new" and date constructor.
Type script uses following date functions
getHours()--> returns the hour number in 24 hour format
getMinutes()--> return the minute number.
getSecond()-->return the second number.
getDay()--> return the week day number.
Example Sunday=0
getDate()---Returns the date number
getMonth()-->Returns the month number
getYear()-->Returns the year number as per y2k
getFullYear()--> Returns full year number
toLocaleDateString()-->Returns short date format
toLocaleTimeString()-->Returns short time format
Example
No comments:
Post a Comment
Thank you for visiting my blog