How to getCurrent time without using picker


#1

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).


#2

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


#3

You can log this

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

#4

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


#5

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();


#6

@MustafaLokhandwala suggest you a right solution.

thanks.