Skip to content

cotrNow

The C# DateTime.Now property.

Aliases:

  • cotrNow
  • now
  • currentTime
  • dateNow

cpp

std::chrono::system_clock::now()

csharp

DateTime.Now

dart

DateTime.now()

haskell

-- Use the 'time' package to get the current date and time.

java

import java.time.LocalDate;
LocalDate now = LocalDate.now();

javascript

new Date()

javascriptreact

new Date()

kotlin

import java.time.LocalDate
val now: LocalDate = LocalDate.now()

perl

use DateTime
DateTime->now

powershell

Terminal window
Get-Date

python

from datetime import datetime
now = datetime.now()

r

Sys.Date()

ruby

require 'date'
Date.today

rust

// Rust does not have a built-in Date type.
// Use the chrono crate to get the current date and time.
use chrono::Utc;
Utc::now()

scala

// Use java.time or ScalaTime to get the current date and time.

shellscript

Terminal window
# Get the current date and time:
now(date)

swift

Date()

typescript

new Date()

typescriptreact

new Date()