How to get local time from UTC using Moment.JS


Moment.JS is a beautiful javascript library for parsing, validating, manipulating, and formatting dates. This is a must have utility library when it comes to manipulating timestamps and dates in javascript.

Here I will show how to get local time if you have a utc date time string.

Lets say you have a UTC date-time string as 2014-02-19 05:24:32 AM and you want to determine time in your timezone then use following code:
 moment.utc('2014-02-19 05:24:32 AM').toDate();

toDate() method gives javascript Date() object.

Below I have shared an example of how to use it. You can click on JavaScript link below to see the code.

Comments

Anonymous said…
nice
for ict 99 said…
Hi, Great.. Tutorial is just awesome..It is really helpful for a newbie like me.. I am a regular follower of your blog. Really very informative post you shared here. Kindly keep blogging. If anyone wants to become a Front end developer learn from Javascript Training in Chennai . or Javascript Training in Chennai. Nowadays JavaScript has tons of job opportunities on various vertical industry. JavaScript Training in Chennai
ASO Services said…
There are so many useful information in your post, I like it all the time. And I want to share this boost app ranking with you, you can take a look. This is very useful.
Naveen S said…
Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
Webdesining course in chennai
Unknown said…
Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.
hadoop training in chennai

angularjs training in chennai
Unknown said…
Thanks a lot very much for the high quality and results-oriented help. I won’t think twice to endorse your blog post to anybody who wants and needs support about this area. We are providing AngularJS training in Velachery.

For more details: AngularJs training in velachery
Unknown said…
Needed to compose you a very little word to thank you yet again regarding the nice suggestions you’ve contributed here. we are providing AngularJs training in velachery.
for more details: AngularJs training in velachery
mani said…
Good Post! Thank you so much for sharing this pretty post, it was so good to read and useful to improve my knowledge as updated one, keep blogging.

website builder for reseller
mani said…
Thank you for the link building list.I am going jot down this because it will help me a lot.Great blog! Please keep on posting such blog.

private label website builder
mani said…
Comfortabl y, the post is really the freshest on that deserving topic. I harmonise with your conclusions and definitely will thirstily look forward to your next updates. Simply saying thanks will not simply just be adequate, for the extraordinary clarity in your writing.

white label website builder
priya said…
I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone
Data Science Training in Chennai
Data Science training in kalyan nagar
Data science training in Bangalore
Data Science training in marathahalli
Data Science interview questions and answers
Data science training in bangalore
Manipriyan said…
Pretty blog, so many ideas in a single site, thanks for the informative article, keep updating more article.

AWS Training in Chennai
Blue Prism Training in Chennai
Manipriyan said…
I really like the dear information you offer in your articles. I’m able to bookmark your site and show the kids check out up here generally. Im fairly positive theyre likely to be informed a great deal of new stuff here than anyone

Angular JS Training in Chennai
Uipath Training in Chennai
for ict 99 said…
IEEE Project Domain management in software engineering is distinct from traditional project deveopment in that software projects have a unique lifecycle process that requires multiple rounds of testing, updating, and faculty feedback. A IEEE Domain project Final Year Projects for CSE system development life cycle is essentially a phased project model that defines the organizational constraints of a large-scale systems project. The methods used in a IEEE DOmain Project systems development life cycle strategy Project Centers in Chennai For CSE provide clearly defined phases of work to plan, design, test, deploy, and maintain information systems.


This is enough for me. I want to write software that anyone can use, and virtually everyone who has an internet connected device with a screen can use apps written in JavaScript. JavaScript Training in Chennai JavaScript was used for little more than mouse hover animations and little calculations to make static websites feel more interactive. Let’s assume 90% of all websites using JavaScript use it in a trivial way. That still leaves 150 million substantial JavaScript Training in Chennai JavaScript applications.
Thanks for Sharing This Article.It is very so much valuable content. I hope these Commenting lists will help to my website
top microservices online training
Priyanka said…
Attend The Machine Learning courses in Bangalore From ExcelR. Practical Machine Learning courses in Bangalore Sessions With Assured Placement Support From Experienced Faculty. ExcelR Offers The Machine Learning courses in Bangalore.
ExcelR Machine Learning courses in Bangalore
offpageseo70 said…

Nice blog,I understood the topic very clearly,And want to study more like this.
Data Scientist Course
Great post i must say and thanks for the information. Education is definitely a sticky subject. However, is still among the leading topics of our time. I appreciate your post and look forward to more.

data science course
CloudLearn ERP said…
Thanks for the information about call centers. It is always great to read about this ever changing industry.
Best Data Science training in Mumbai

Data Science training in Mumbai
I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

Simple Linear Regression

Correlation vs Covariance
Yamini said…
Thank you for such a wonderful blog. It's a very great concept and I learn more details from your blog. Try
Elasticsearch Training
AWS Devops Training
CyberSecurity Training
priyanka said…
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
Correlation vs Covariance
Simple linear regression
data science interview questions
cool stuff you have and you keep overhaul every one of us

Simple Linear Regression

Correlation vs Covariance
radhika said…
Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article.

AWS training in Chennai

AWS Online Training in Chennai

AWS training in Bangalore

AWS training in Hyderabad

AWS training in Coimbatore

AWS training



360digiTMG said…
Really nice and interesting post. I was looking for this kind of information and enjoyed reading this one. Keep posting. Thanks for sharing.
tableau training in guduvanchery
EXCELR said…
Thanks for sharing nice information data science training Hyderabad
EXCELR said…
http://www.digitoffee.com/2014/02/how-to-get-local-time-from-utc-using.html
Revathi said…
Hi to everybody, here everyone is sharing such knowledge, so it’s fastidious to see this site, and I used to visit this blog daily.keep sharing!!


android training in chennai

android online training in chennai

android training in bangalore

android training in hyderabad

android Training in coimbatore

android training

android online training

CloudLearn ERP said…
The content that I normally go through in the recent times is nothing like what you have on paper. Thank you for writing this!
Data Science training in Mumbai
Data Science course in Mumbai
SAP training in Mumbai

hrithiksai said…
Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad

Popular posts from this blog

Step by step Cordova calabash-ios automation

Measure the height of keyboard on PhoneGap app using jQuery