What Is Today’s Date?

Wednesday, September 18, 2024

Today, September 18, is day 262 of 366 total days in 2024.

Popular Date Formates

  • MM-DD-YYYY: 09-18-2024
  • DD-MM-YYYY: 18-09-2024
  • YYYY-MM-DD: 2024-09-18
  • MM/DD/YYYY: 09/18/2024
  • DD/MM/YYYY: 18/09/2024
  • What is today’s date?

    The today's date is Wednesday, September 18, 2024

    What is tomorrow’s date?

    The tomorrow's date is Thursday, September 19, 2024

    What is yesterday's date?

    The yesterday's date is Tuesday, September 17, 2024

    Here's how to get today's date in various popular programming languages:

    JavaScript

    let today = new Date();
    let formattedDate = today.getFullYear() + '-' + (today.getMonth() + 1).toString().padStart(2, '0') + '-' + today.getDate().toString().padStart(2, '0');
    console.log(formattedDate); // Outputs: 2024-09-18

    PHP

    echo date('Y-m-d'); // Outputs:2024-09-18

    Python

    from datetime import date
    print(date.today()) # Outputs: 2024-09-18

    Java

    import java.time.LocalDate;
    
    public class Main {
        public static void main(String[] args) {
            LocalDate today = LocalDate.now();
            System.out.println(today);  
        }
    } // Outputs: 2024-09-18

    C#

    using System;
    
    class Program {
        static void Main() {
            DateTime today = DateTime.Today;
            Console.WriteLine(today.ToString("yyyy-MM-dd")); 
        }
    }  // Outputs: 2024-09-18

    Ruby

    require 'date'
    puts Date.today  # Outputs: 2024-09-18

    C++

    #include 
    #include 
    
    int main() {
        time_t t = time(nullptr);
        tm* tPtr = localtime(&t);
        std::cout << (tPtr->tm_year + 1900) << '-' 
                  << (tPtr->tm_mon + 1) << '-' 
                  << tPtr->tm_mday << std::endl;  // Outputs: 2024-09-18    return 0;
    }
    

    Go

    package main
    
    import (
        "fmt"
        "time"
    )
    
    func main() {
        today := time.Now().Format("2006-01-02")
        fmt.Println(today)  
    } // Outputs: 2024-09-18

    Swift

    import Foundation
    
    let today = Date()
    let formatter = DateFormatter()
    formatter.dateFormat = "yyyy-MM-dd"
    let formattedDate = formatter.string(from: today)
    print(formattedDate)  // Outputs: 2024-09-18

    Kotlin

    import java.time.LocalDate
    
    fun main() {
        val today = LocalDate.now()
        println(today) 
    }  // Outputs: 2024-09-18

    R

    print(Sys.Date())  # Outputs: 2024-09-18