Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

define datemethod in javascript

// EXAMPLE : 

        // Print today full date & full time:
        let today = [
            "Date:" + now.getDate(),
            "Month: " + (now.getMonth() + 1),
            "Year: " + now.getFullYear(),
            "Day: " + now.getDay(),
            "Hours: " + now.getHours(), "Minutes: " + now.getMinutes(),
            "Seconds: " + now.getSeconds(),
            "Milisecondss: " + now.getMilliseconds()]

        let today_data = today.forEach((ele => document.write(ele + "<br>")));

        document.write(today_data());
        // OUTPUT:
        // Date: 12
        // Month: 10
        // Year: 2022
        // Day: 3
        // Hours: 23
        // Minutes: 31
        // Seconds: 12
        // Milisecondss: 178
Source by www.geeksforgeeks.org #
 
PREVIOUS NEXT
Tagged: #define #datemethod #javascript
ADD COMMENT
Topic
Name
9+5 =