Current Unix Timestamp SECONDS SINCE JAN 01 1970

Current UTC Time
2025-08-20
How to convert Local Time to UTC in common programming languages

Local Time to UTC by Language

Language Code to Convert Local Time to UTC
Ada Local_Time.To_UTC(Time_Now)
AutoHotKey EnvAdd, LocalTime, % A_TimeZone * -60, Minutes
Ballerina time:utc = time:civilToUtc(civil);
Bash date -u
C++ std::time_t local = std::time(nullptr); std::gmtime(&local);
C# DateTime.Now.ToUniversalTime();
Cobol MOVE FUNCTION WHEN-COMPILED TO WS-UTC-TIME
ColdFusion dateConvert("local2UTC", now())
Common Lisp (local-time:timestamp-to-universal (local-time:now))
CQL (Cassandra) SELECT CAST(dateOf(now()) AT TIMEZONE 'UTC' AS timestamp);
Crystal Time.local.to_utc
Dart DateTime.now().toUtc()
DAX UTCNOW()
Elixir DateTime.now!("Etc/UTC")
Erlang calendar:local_time_to_universal_time(calendar:local_time())
Excel =CONVERT(NOW(), "Local", "UTC")
Fortran call localtime(time, values); call gmtime(time, utc_values)
Forth time&date utc-time
F# DateTime.Now.ToUniversalTime()
Go time.Now().UTC()
Groovy TimeZone.getDefault().convertLocalToUTC(new Date())
Haskell localTimeToUTC <$> getTimeZone <*> getLocalTime
Haxe Date.now().getTime() - Date.fromTime(0).getTimezoneOffset() * 60000
Io Date clone removeGMTOffset
Java ZonedDateTime.now().withZoneSameInstant(ZoneOffset.UTC)
JavaScript new Date().toUTCString()
Julia using Dates; now(UTC)
Kotlin ZonedDateTime.now().withZoneSameInstant(ZoneOffset.UTC)
Laravel now()->utc()
Lua os.time(os.date("!*t"))
MATLAB datetime('now', 'TimeZone', 'local', 'Format', 'UTC')
MySQL CONVERT_TZ(NOW(), @@session.time_zone, 'UTC')
Nim getTime().local.utc
Objective-C [NSDate date].timeIntervalSinceReferenceDate - [[NSTimeZone localTimeZone] secondsFromGMT]
OCaml Unix.gmtime (Unix.time ())
Pascal LocalTimeToUniversal(Now);
Perl DateTime->now(time_zone => 'UTC')
PHP gmdate('Y-m-d H:i:s')
PL/SQL SELECT SYS_EXTRACT_UTC(SYSTIMESTAMP) FROM DUAL;
PostgreSQL SELECT NOW() AT TIME ZONE 'UTC';
PowerShell [System.TimeZoneInfo]::ConvertTimeToUtc((Get-Date), [System.TimeZoneInfo]::Local)
Prolog get_time(Local), stamp_date_time(Local, UTC, 0).
Python datetime.now().astimezone(timezone.utc)
R as.POSIXct(Sys.time(), tz = "UTC")
Racket (current-seconds)
React new Date().toUTCString()
Ruby Time.now.utc
Rust Local::now().with_timezone(&Utc)
SAS %let utc_time = %sysfunc(datetime(), E8601DT.)
Scala ZonedDateTime.now().withZoneSameInstant(ZoneOffset.UTC)
Scheme (time-local->utc (current-time))
SQLite datetime(CURRENT_TIMESTAMP, 'utc')
SML Date.toTime(Date.fromTimeUniv(Time.now()))
Swift Date().timeIntervalSinceReferenceDate - TimeZone.current.secondsFromGMT()
TCL clock format [clock seconds] -timezone :UTC
T-SQL SELECT GETUTCDATE();
TypeScript new Date().toUTCString()
V time.now().utc()
VBScript DateAdd("n", TimeZoneOffset, Now)
Vala var now = new DateTime.now_utc();
Xojo DateTime.Now.ToUniversal
Zig std.time.timestamp().toUTC()
Current Unix Timestamp SECONDS SINCE JAN 01 1970

Current UTC Time
2025-08-20
Ad Banner Placeholder
Ad Banner Placeholder
Ad Banner Placeholder
Ad Banner Placeholder