How to getCurrent time without using picker

How to get CurrentTime in ionic framework without using date and time pickers.

TimsStamp on image.
Ex:
As instagram posts get updated with both time and address(GPS).

you can use simple date() function to get current time

You can log this

let date = new Date()
console.log("Current Date ",date) 
3 Likes

They have removed javascript in ionic version 2

How to use javascript snippet in ionic framework

Date() object is not working in ionic as we have to write in transcript

in ionic we have to use typescript which is another advance version of javascript or ES so you can use all the function of javascript.

to get current timestamp in typescript
currDate:any=new Date().toIsoString();

3 Likes

@MustafaLokhandwala suggest you a right solution.

thanks.