Skip to main content
1-Visitor
February 3, 2020
Solved

Give current date and time values in value 2Dwidget

  • February 3, 2020
  • 1 reply
  • 1845 views

hi community, thanks for your help.

how can i give a current date and time values in a value 2D widget, or any other 2Dwidget??

please, i need yor help.

 

Best answer by RolandRaytchev

Hi @Burubae ,  @

 

there are  a lot of ways to implement this, but the most of them are based on the JavaScipt now() functionality (Date(Date.now())

e.g. to print in the console the complete data is something like :

 

console.info("started $ionicView.afterEnter at time: "+Date(Date.now()))
// or direct assign to a lable
$scope.view.wdg['label-2'].text= "Current data&time: "+Date(Date.now()));

 

so it will print e.g. to the console:

started $ionicView.afterEnter at time: Tue Feb 04 2020 11:30:08 GMT+0100 (Central European Standard Time)

 

 One further important question is how to extract the correct data / e.g. the time or only the date or only the day ... etc. where are different methods which are supported by the Date object but all of this you can find in programming forums for javascript general programming e.g.

JavaScript Get Date Methods”,

Getting current date and time in JavaScript

 “https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime

Or https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Date/now

etc... 

1 reply

21-Topaz I
February 4, 2020

Hi @Burubae ,  @

 

there are  a lot of ways to implement this, but the most of them are based on the JavaScipt now() functionality (Date(Date.now())

e.g. to print in the console the complete data is something like :

 

console.info("started $ionicView.afterEnter at time: "+Date(Date.now()))
// or direct assign to a lable
$scope.view.wdg['label-2'].text= "Current data&time: "+Date(Date.now()));

 

so it will print e.g. to the console:

started $ionicView.afterEnter at time: Tue Feb 04 2020 11:30:08 GMT+0100 (Central European Standard Time)

 

 One further important question is how to extract the correct data / e.g. the time or only the date or only the day ... etc. where are different methods which are supported by the Date object but all of this you can find in programming forums for javascript general programming e.g.

JavaScript Get Date Methods”,

Getting current date and time in JavaScript

 “https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime

Or https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Date/now

etc... 

Burubae1-VisitorAuthor
1-Visitor
February 4, 2020

thank you so much for your help!!!✌️💚👨‍💻💪