# Returning Date or Time in double digits

You can force a leading 0 to be present where needed on date time parts via JavaScript.

An example getting the current month and returning to a CallScripter Field/Variable called "monthNumber":

```var currentDate = new Date(); var month = currentDate.getUTCMonth() + 1; [monthNumber] = month;```

This can be used for a complete date time formatted string to ensure format compliance:

```var currentDate = new Date(); var year = currentDate.getFullYear(); var month = currentDate.getMonth() + 1; if(month < 10) month = "0" + month; var day = currentDate.getDate(); if(day < 10) day = "0" + day; var hours = currentDate.getHours(); if(hours < 10) hours = "0" + hours; var minutes = currentDate.getMinutes(); if(minutes < 10) minutes = "0" + minutes; var seconds = currentDate.getSeconds(); if(seconds < 10) seconds = "0" + seconds; [callDate] = year + "-" + month + "-" + day + " " + hours + ":" + minutes + ":" + seconds; ```
{"ft_lang_label":"__label__en","ft_lang_prob":0.57539946,"math_prob":0.9964368,"size":999,"snap":"2022-05-2022-21","text_gpt3_token_len":263,"char_repetition_ratio":0.19296482,"word_repetition_ratio":0.023809524,"special_character_ratio":0.34234235,"punctuation_ratio":0.20555556,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9817329,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-05-24T08:52:51Z\",\"WARC-Record-ID\":\"<urn:uuid:6c39d023-c9d7-4b3b-8cd7-6c02fdfc030b>\",\"Content-Length\":\"23866\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:0305fa07-b30e-4c8c-a856-4c442d993501>\",\"WARC-Concurrent-To\":\"<urn:uuid:9a8eb536-4001-41d9-96b6-52da9d38771a>\",\"WARC-IP-Address\":\"52.18.34.1\",\"WARC-Target-URI\":\"https://helpdesk.callscripter.com/kb/a672/returning-date-or-time-in-double-digits.aspx\",\"WARC-Payload-Digest\":\"sha1:CWXJX5DAV4UNIJIUWQUMFELFY4AYQACC\",\"WARC-Block-Digest\":\"sha1:JX45HFP4ZAXEQKCRHJRYHSIL6OX4BARA\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-21/CC-MAIN-2022-21_segments_1652662570051.62_warc_CC-MAIN-20220524075341-20220524105341-00189.warc.gz\"}"}