How do I display time and date but like this?

0 favourites
  • 4 posts
From the Asset Store
An educational game for Times Table. An easy to use template for developers to build larger games
  • Hello guys,

    How do i display time and date but like this

    Friday, December, 11 2020 and time like 3 pm ?

    Thanks

  • -> CurDate: Set text to Date.ToDateString(Date.Now) & " " & Date.ToLocaleTimeString(Date.Now)

    This is how to do it using Constructs built in Date object.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • -> CurDate: Set text to Date.ToDateString(Date.Now) & " " & Date.ToLocaleTimeString(Date.Now)

    This is how to do it using Constructs built in Date object.

    construct 2 or 3?

  • Sorry, you're right, I didn't notice this was in the Construct 2 forum. I just saw it under the unanswered questions.

    In Construct 2, you would do something like this:

    -> CurDate: Set text to left(Browser.ExecJS("Date()"), 24)

    This gives this result for me right now:

    Sat Dec 12 2020 09:30:49

    I believe the time is displayed in 24 hour format so instead of am/pm, you get a value between 0 and 23. If you need the date formatted exactly the way it is in your post, you will either have to modify it yourself or see if there is a plugin that will do it for you. I believe there is a pretty good date plugin from RexRainbow you could look at.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)