Get your current local date and time with .now()


Description: Get the current local date and time.


<!doctype html>
    <html lang="en">
      <meta charset="utf-8">
      <title>now demo</title>
      <script src=""></script>
      <span class="date"></span><br />
      <span class="time"></span>
            bitsyCode(".date").html({ format:"%D, %d %MM %Y" }));
               bitsyCode(".time").html({ format:"%H : %m : %s %p" }));
            }, 1000);


  • Usage

    • How to use:

      Get your current local date and time, with formatting options

    • Simple Usage: //Using default settings
    • Custom Formatting:{ format: '%d/%M/%Y %H:%m:%s' }) // day/month/year hours:minutes:seconds
    • With 12-hour time:{ format: '%d/%M/%Y %H:%m:%s', _12hour:true }) // hours:minutes:seconds (12-hour time format)
  • Options

    • Date formatting (List below)

      format: '%d-%M-%Y %H:%m:%s' (default value), view the complete format list below.

      Get UTC Full Year

      '%Y' // get UTC Full Year

      Get Month in numeric value

      '%M' // get month in numeric value

      Get Month in string value

      '%MM' // get month name in string

      Get Day in numeric value

      '%d' // get numeric Day

      Get Day in string value

      '%D' // get numeric Day

      Get time Hours

      '%H' // get Hours

      Get time Minutes

      '%m' // get Minutes

      Get time Seconds

      '%s' // get Seconds

      Get time period, (AM or PM)

      '%p' // get Period either am or pm

    • Setting 12-hour time format
      _12hour: false (default value) // Set this to true if you want a 12-hour time format
  • Returns

    • Returns: Current formatted local date.