![]() If you want to format the date in a more user-friendly format (e.g.If you want to make the date interpreted as UTC instead of local timezone, use toUTCString().If you only want to get the time part, use toTimeString().If you only want to get the date part, use toDateString().If the this value does not inherit from Date.prototype, a TypeError is thrown. For example: "Thu 00:00:00 GMT 0000 (Coordinated Universal Time)".ĭ() must be called on Date instances. ![]() () returns a string representation of the Date as interpreted in the local timezone, containing both the date and the time - it joins the string representation specified in toDateString() and toTimeString() together, adding a space in between. The Date object overrides the toString() method of Object. However, still calls this.toString() internally. Because Date has a method, that method always takes priority over toString() when a Date object is implicitly coerced to a string. The toString() method is part of the type coercion protocol.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |