Skip to content

Commit db40f13

Browse files
Update - How do you convert date to another timezone in javascript
Using the javascript date function to provide expected result
1 parent 17fb078 commit db40f13

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3330,7 +3330,7 @@
33303330
You can use the toLocaleString() method to convert dates in one timezone to another. For example, let's convert current date to British English timezone as below,
33313331
33323332
```javascript
3333-
console.log(event.toLocaleString("en-GB", { timeZone: "UTC" })); //29/06/2019, 09:56:00
3333+
console.log(new Date().toLocaleString("en-GB", { timeZone: "UTC" })); //29/06/2019, 09:56:00
33343334
```
33353335
33363336
**[⬆ Back to Top](#table-of-contents)**

0 commit comments

Comments
 (0)