=== modified file 'src/com/goldencode/p2j/util/date.java'
--- old/src/com/goldencode/p2j/util/date.java
+++ new/src/com/goldencode/p2j/util/date.java
@@ -245,6 +245,8 @@
 ** 110 RNC 20260521          Instantiate the date primitive type as unknown if a null value is provided.
 ** 111 AS  20260831          Dropped 'synchronized' from initialValue(): the container is a static singleton,
 **                           so the monitor serialized every context in the JVM while protecting no state.
+** 112 SP  20261110          TODAY, TIME and TIMEZONE read the clock once and use TimeZone.getOffset().
+**                           TIME follows SESSION:TIMEZONE.
 */
 
 /*
@@ -1560,28 +1562,33 @@
    }
    
    /**
-    * Get the default timezone for the date received as parameter. In case of null,
-    * the default JVM timezone's "offset" (raw + dst) converted from milliseconds to 
-    * minutes.
-    * 
+    * Get the default timezone offset, in minutes, for the date received as parameter: the
+    * SESSION:TIMEZONE offset if set, otherwise the default JVM timezone's raw offset plus its DST
+    * savings when the date is in daylight time. In case of null, the offset at the current instant
+    * (see {@link #currentOffset(long)}).
+    *
     * @param    d
-    *           The date for which we want to calculate the timezone's offset.
-    * 
-    * @return   The default timezone.
+    *           The date for which we want to calculate the timezone's offset, or {@code null} for now.
+    *
+    * @return   The default timezone offset in minutes.
     */
    public static int getDefaultOffset(Date d)
    {
+      if (d == null)
+      {
+         return currentOffset(System.currentTimeMillis());
+      }
+
       integer tzAttr = work.obtain().timezoneOffset; // date.getSessionTimeZone()
       int     offset = 0;
-      
+
       if (tzAttr.isUnknown())
       {
          // get the raw offset in millis and convert it to minutes
          TimeZone defTz = TimeZone.getDefault(); 
          // it seems that in Progress the timezone also contains the DST
          offset = defTz.getRawOffset();
-         if (d == null && defTz.inDaylightTime(new Date()) || 
-             d != null && defTz.inDaylightTime(d))
+         if (defTz.inDaylightTime(d))
          {
             offset += defTz.getDSTSavings();
          }
@@ -1594,7 +1601,38 @@
       
       return offset;
    }
-   
+
+   /**
+    * Get the default timezone offset at an instant: the SESSION:TIMEZONE offset if set, otherwise
+    * the offset of the default JVM timezone at that instant, DST included.
+    *
+    * @param    utc
+    *           The instant, in milliseconds since the Java epoch.
+    *
+    * @return   The offset in minutes from UTC.
+    */
+   static int currentOffset(long utc)
+   {
+      integer tzAttr = work.obtain().timezoneOffset;
+
+      // getOffset() rather than raw offset plus DST savings: the two differ in zones such as
+      // Africa/Casablanca, whose DST data does not fit a fixed DST amount
+      return tzAttr.isUnknown() ? TimeZone.getDefault().getOffset(utc) / (1000 * 60) : tzAttr.intValue();
+   }
+
+   /**
+    * Get the wall clock of the default timezone (see {@link #currentOffset(long)}) at an instant.
+    *
+    * @param    utc
+    *           The instant, in milliseconds since the Java epoch.
+    *
+    * @return   The local date and time, in milliseconds since the Java epoch.
+    */
+   static long localMillis(long utc)
+   {
+      return utc + currentOffset(utc) * 60_000L;
+   }
+
    /**
     * Get the default timezone as specified in the SESSION:TIMEZONE offset or
     * if not specified there, the default JVM timezone.
@@ -1610,7 +1648,7 @@
     * Obtains the effective default timezone offset in minutes from UTC for
     * this user's context. This will get the default timezone as specified in
     * the SESSION:TIMEZONE offset or if not specified there, the default JVM
-    * timezone's "raw offset" (in milliseconds) converted to minutes.  This is
+    * timezone's offset at the current instant, DST included (see {@link #currentOffset(long)}).  This is
     * a form of the TIMEZONE built-in function.
     *
     * @return   The effective default timezone offset in minutes from UTC.
@@ -2045,14 +2083,14 @@
    }
 
    /**
-    * Returns the number of seconds since midnight in the current JVM timezone.
+    * Returns the number of seconds since midnight in the SESSION:TIMEZONE, or in the JVM timezone
+    * when that is not set. This is the TIME built-in function.
     *
     * @return   The number of seconds since midnight.
     */
    public static int64 secondsSinceMidnight()
    {
-      // this represents the current time in the default JVM timezone
-      return secondsSinceMidnight(new GregorianCalendar());
+      return int64.of(Math.floorMod(localMillis(System.currentTimeMillis()), MILLIS_PER_DAY) / 1000);
    }
    
    /**
@@ -2105,7 +2143,8 @@
    }
    
    /**
-    * Creates an instance that represents today's date using the local system clock time.
+    * Creates an instance that represents today's date in the SESSION:TIMEZONE, or in the JVM timezone when
+    * that is not set.
     * @return today's date
     */
    public static date today()
@@ -4272,13 +4311,13 @@
    }
       
    /**
-    * Calculates the current date using the local system clock time.
+    * Calculates the current date in the SESSION:TIMEZONE, or in the JVM timezone when that is not set.
     *
     * @return   The current date as a julian day number.
     */
    private static long _today()
    {
-      return millisToJulianDay(dateToLocalMillis(null, date.getDefaultTimeZone()));
+      return Math.floorDiv(localMillis(System.currentTimeMillis()), MILLIS_PER_DAY) + JULIAN_EPOCH_OFFSET;
    }
    
    /**
=== modified file 'src/com/goldencode/p2j/util/datetime.java'
--- old/src/com/goldencode/p2j/util/datetime.java
+++ new/src/com/goldencode/p2j/util/datetime.java
@@ -66,6 +66,7 @@
 ** 035 AL2 20250530 Added getIndependentFromContext.
 ** 036 VVT 20260107 Adapt to date class changes, add missing @Override annotations, remove unused imports
 **                  and obsolete instantiateUnknownDatetime() method. See #9846.
+** 037 SP  20261110 now() and millisecondsSinceMidnight() read the clock once, without calendars.
 */
 
 /*
@@ -860,13 +861,13 @@
    /**
     * Creates an instance that represents current date and time using the default timezone.
     * This is the equivalent of the NOW built-in function.
+    *
+    * @return   The current date and time in the SESSION:TIMEZONE, or in the JVM timezone when that is
+    *           not set.
     */
    public static datetime now()
    {
-      TimeZone sessionTz = date.getDefaultTimeZone();
-      GregorianCalendar now = getZoneCalendar(sessionTz);
-      
-      return new datetime(date.today(), datetime.millisSinceMidnight(now));
+      return nowAt(System.currentTimeMillis());
    }
    
    /**
@@ -1447,7 +1448,7 @@
     */
    public static integer millisecondsSinceMidnight()
    {
-      return new integer(datetime.now().time);
+      return new integer(Math.floorMod(date.localMillis(System.currentTimeMillis()), date.MILLIS_PER_DAY));
    }
 
    /**
@@ -2951,22 +2952,23 @@
    }
    
    /**
-    * Extract the portion of the calendar representing the number of
-    * milliseconds since midnight.
+    * Creates an instance with the date and time of the SESSION:TIMEZONE, or of the JVM timezone when
+    * that is not set, at the given instant.
     *
-    * @param    cal
-    *           The calendar instance to query.
+    * @param    utc
+    *           The instant, in milliseconds since the Java epoch.
     *
-    * @return   The milliseconds since midnight.
+    * @return   The date and time at that instant.
     */
-   private static int millisSinceMidnight(Calendar cal)
+   static datetime nowAt(long utc)
    {
-      int hour   = cal.get(Calendar.HOUR_OF_DAY);
-      int mins   = cal.get(Calendar.MINUTE);
-      int secs   = cal.get(Calendar.SECOND);
-      int millis = cal.get(Calendar.MILLISECOND);
-      
-      return (((((hour * 60) + mins) * 60) + secs) * 1000) + millis;
+      long     local = date.localMillis(utc);
+      datetime ret   = new datetime();
+
+      ret.setDayNumber(Math.floorDiv(local, date.MILLIS_PER_DAY) + date.JULIAN_EPOCH_OFFSET);
+      ret.setTime(Math.floorMod(local, date.MILLIS_PER_DAY));
+
+      return ret;
    }
    
    /**
=== modified file 'src/com/goldencode/p2j/util/datetimetz.java'
--- old/src/com/goldencode/p2j/util/datetimetz.java
+++ new/src/com/goldencode/p2j/util/datetimetz.java
@@ -2,7 +2,7 @@
 ** Module   : datetimetz.java
 ** Abstract : Progress 4GL compatible datetime-tz object
 **
-** Copyright (c) 2013-2025, Golden Code Development Corporation.
+** Copyright (c) 2013-2026, Golden Code Development Corporation.
 **
 ** -#- -I- --Date-- ------------------------------------Description------------------------------------------
 ** 001 GES 20130128 Initial commit with basic functionality.
@@ -69,6 +69,7 @@
 ** 033 ICP 20250129 Used int64.of to leverage caches instances.
 ** 034 AL2 20250530 Added getIndependentFromContext.
 ** 035 AS  20260421 Offset the BC epoch years by 1 to account for 0 based years in OffsetDateTime.
+** 036 SP  20261110 now() reads the clock once and sets its value directly.
 */
 
 /*
@@ -1211,13 +1212,7 @@
     */
    public static datetimetz now()
    {
-      // NOW uses the SESSION:TIME-ZONE if set or local-time otherwise
-      integer sessionOffset = date.getTimeZone();
-      int sessOffset = sessionOffset.isUnknown() ?
-            datetimetz.getDefaultTimezoneOffset(null) :
-            sessionOffset.intValue();
-      
-      return new datetimetz(datetime.now(), sessOffset);
+      return nowAt(System.currentTimeMillis());
    }
    
    /**
@@ -2427,6 +2422,29 @@
    }
    
    /**
+    * Creates an instance for the given instant, with the SESSION:TIMEZONE offset, or the JVM timezone's
+    * offset at that instant when that is not set.
+    *
+    * @param    utc
+    *           The instant, in milliseconds since the Java epoch.
+    *
+    * @return   The datetime-tz value of that instant.
+    */
+   static datetimetz nowAt(long utc)
+   {
+      // the wall clock comes from the same offset that is stored, so they always agree
+      int        offset = date.currentOffset(utc);
+      long       local  = utc + offset * 60_000L;
+      datetimetz ret    = new datetimetz();
+
+      ret.setDayNumber(Math.floorDiv(local, date.MILLIS_PER_DAY) + date.JULIAN_EPOCH_OFFSET);
+      ret.setTime(Math.floorMod(local, date.MILLIS_PER_DAY));
+      ret.setTimeZoneOffset(offset);
+
+      return ret;
+   }
+
+   /**
     * Private utility method that returns a Calendar value as string in ISO format 
     * (yyyy-MM-dd hh:mm:ss.ttt).
     * 
=== added file 'test/com/goldencode/p2j/util/DatetimetzNowTest.java'
--- old/test/com/goldencode/p2j/util/DatetimetzNowTest.java
+++ new/test/com/goldencode/p2j/util/DatetimetzNowTest.java
@@ -0,0 +1,497 @@
+/*
+** Module   : DatetimetzNowTest.java
+** Abstract : Tests for NOW and the clock functions that share its code.
+**
+** Copyright (c) 2026, Golden Code Development Corporation.
+**
+** -#- -I- --Date-- ---------------------------------Description---------------------------------
+** 001 SP  20261110 Created initial version.
+*/
+
+/*
+** This program is free software: you can redistribute it and/or modify
+** it under the terms of the GNU Affero General Public License as
+** published by the Free Software Foundation, either version 3 of the
+** License, or (at your option) any later version.
+**
+** This program is distributed in the hope that it will be useful,
+** but WITHOUT ANY WARRANTY; without even the implied warranty of
+** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+** GNU Affero General Public License for more details.
+**
+** You may find a copy of the GNU Affero GPL version 3 at the following
+** location: https://www.gnu.org/licenses/agpl-3.0.en.html
+**
+** Additional terms under GNU Affero GPL version 3 section 7:
+**
+**   Under Section 7 of the GNU Affero GPL version 3, the following additional
+**   terms apply to the works covered under the License.  These additional terms
+**   are non-permissive additional terms allowed under Section 7 of the GNU
+**   Affero GPL version 3 and may not be removed by you.
+**
+**   0. Attribution Requirement.
+**
+**     You must preserve all legal notices or author attributions in the covered
+**     work or Appropriate Legal Notices displayed by works containing the covered
+**     work.  You may not remove from the covered work any author or developer
+**     credit already included within the covered work.
+**
+**   1. No License To Use Trademarks.
+**
+**     This license does not grant any license or rights to use the trademarks
+**     Golden Code, FWD, any Golden Code or FWD logo, or any other trademarks
+**     of Golden Code Development Corporation. You are not authorized to use the
+**     name Golden Code, FWD, or the names of any author or contributor, for
+**     publicity purposes without written authorization.
+**
+**   2. No Misrepresentation of Affiliation.
+**
+**     You may not represent yourself as Golden Code Development Corporation or FWD.
+**
+**     You may not represent yourself for publicity purposes as associated with
+**     Golden Code Development Corporation, FWD, or any author or contributor to
+**     the covered work, without written authorization.
+**
+**   3. No Misrepresentation of Source or Origin.
+**
+**     You may not represent the covered work as solely your work.  All modified
+**     versions of the covered work must be marked in a reasonable way to make it
+**     clear that the modified work is not originating from Golden Code Development
+**     Corporation or FWD.  All modified versions must contain the notices of
+**     attribution required in this license.
+*/
+
+package com.goldencode.p2j.util;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import java.util.*;
+
+import org.junit.jupiter.api.*;
+
+/**
+ * Tests for {@link datetimetz#now()} and the clock functions that share its code: {@link datetime#now()}
+ * ({@code INIT NOW} of a DATETIME, NOW compared with a DATETIME),
+ * {@link datetime#millisecondsSinceMidnight()} (MTIME), {@link date#today()},
+ * {@link date#secondsSinceMidnight()} (TIME) and {@link date#getDefaultTimeZoneOffset()} (TIMEZONE).
+ * <p>
+ * The expected values follow the JDK's rules for the JVM default time zone. OpenEdge uses the machine's
+ * zone the same way; the {@code SESSION:TIMEZONE} cases follow the OpenEdge results of {@code dtz_now.p}.
+ */
+public class DatetimetzNowTest
+{
+   /** Milliseconds per minute. */
+   private static final long MS_PER_MINUTE = 60_000L;
+
+   /** Clock slack allowed between the bounds a test reads and the value under test. */
+   private static final long SLACK_MS = 50L;
+
+   /**
+    * JVM default zones the tests run under: whole-hour, half-hour, 45-minute and +/-14:00 offsets, zones
+    * with DST, and the zones whose DST data makes raw offset plus DST savings differ from the real offset.
+    */
+   private static final String[] ZONES =
+   {
+      "UTC", "Europe/Bucharest", "America/New_York", "America/St_Johns", "Asia/Kolkata", "Asia/Kathmandu",
+      "Australia/Lord_Howe", "Pacific/Chatham", "Pacific/Kiritimati", "Pacific/Pago_Pago",
+      "America/Vancouver", "Africa/Casablanca", "Africa/El_Aaiun", "Africa/Windhoek"
+   };
+
+   /** {@code SESSION:TIMEZONE} values checked against OpenEdge by {@code dtz_now.p}. */
+   private static final int[] SESSION_OFFSETS = { 60, -300, 330, 345, 765, 840, -840, -570, -60 };
+
+   /** The default time zone at the start of each test. */
+   private TimeZone savedZone;
+
+   /**
+    * Saves the default time zone and clears {@code SESSION:TIMEZONE}.
+    */
+   @BeforeEach
+   public void saveZone()
+   {
+      savedZone = TimeZone.getDefault();
+      date.setTimeZone(new integer());
+   }
+
+   /**
+    * Restores the default time zone and clears {@code SESSION:TIMEZONE}.
+    */
+   @AfterEach
+   public void restoreZone()
+   {
+      TimeZone.setDefault(savedZone);
+      date.setTimeZone(new integer());
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} unset, NOW is the current instant and carries the JVM zone's offset at
+    * that instant.
+    */
+   @Test
+   public void nowIsCurrentInstantWithJvmZoneOffset()
+   {
+      List<String> failures = new ArrayList<>();
+      for (String id : ZONES)
+      {
+         TimeZone zone = TimeZone.getTimeZone(id);
+         TimeZone.setDefault(zone);
+
+         long before = System.currentTimeMillis();
+         datetimetz now = datetimetz.now();
+         long after = System.currentTimeMillis();
+
+         long instant = instantOf(now);
+         int expectedOffset = zone.getOffset(instant) / (int) MS_PER_MINUTE;
+         if (instant < before - SLACK_MS || instant > after + SLACK_MS || now.getOffset() != expectedOffset)
+         {
+            failures.add(id + ": instant off by " + (instant - before) + " ms, offset " + now.getOffset() +
+                         " instead of " + expectedOffset);
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} unset, TIMEZONE is the offset NOW carries.
+    */
+   @Test
+   public void timezoneIsOffsetOfNow()
+   {
+      List<String> failures = new ArrayList<>();
+      for (String id : ZONES)
+      {
+         TimeZone.setDefault(TimeZone.getTimeZone(id));
+         int timezone = date.getDefaultTimeZoneOffset().intValue();
+         int nowOffset = datetimetz.now().getOffset();
+         if (timezone != nowOffset)
+         {
+            failures.add(id + ": TIMEZONE " + timezone + ", TIMEZONE(NOW) " + nowOffset);
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} unset, the DATETIME form of NOW (MTIME, {@code INIT NOW}) and TODAY give
+    * the JVM zone's wall clock.
+    */
+   @Test
+   public void datetimeNowAndTodayAreJvmZoneWallClock()
+   {
+      List<String> failures = new ArrayList<>();
+      for (String id : ZONES)
+      {
+         TimeZone zone = TimeZone.getTimeZone(id);
+         TimeZone.setDefault(zone);
+
+         long before = wallClock(zone, System.currentTimeMillis());
+         datetime now = datetime.now();
+         date today = date.today();
+         long after = wallClock(zone, System.currentTimeMillis());
+
+         long wall = localMillisOf(now);
+         if (wall < before - SLACK_MS || wall > after + SLACK_MS)
+         {
+            failures.add(id + ": datetime.now() off by " + (wall - before) + " ms");
+         }
+         if (today.longValue() != dayNumber(before) && today.longValue() != dayNumber(after))
+         {
+            failures.add(id + ": TODAY " + today.longValue() + " instead of " + dayNumber(before));
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} unset, TIME and MTIME are the seconds and milliseconds of the JVM zone's
+    * wall clock.
+    */
+   @Test
+   public void timeAndMtimeAreJvmZoneWallClock()
+   {
+      List<String> failures = new ArrayList<>();
+      for (String id : ZONES)
+      {
+         TimeZone zone = TimeZone.getTimeZone(id);
+         TimeZone.setDefault(zone);
+
+         long before = Math.floorMod(wallClock(zone, System.currentTimeMillis()), date.MILLIS_PER_DAY);
+         long mtime = datetime.millisecondsSinceMidnight().longValue();
+         long time = date.secondsSinceMidnight().longValue();
+         long after = Math.floorMod(wallClock(zone, System.currentTimeMillis()), date.MILLIS_PER_DAY);
+
+         if (todDistance(mtime, before) > SLACK_MS && todDistance(mtime, after) > SLACK_MS)
+         {
+            failures.add(id + ": MTIME off by " + (mtime - before) + " ms");
+         }
+         if (todDistance(time * 1000, before) > 1000 + SLACK_MS &&
+             todDistance(time * 1000, after) > 1000 + SLACK_MS)
+         {
+            failures.add(id + ": TIME off by " + (time * 1000 - before) + " ms");
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} set, NOW is the current instant, carries the session offset, and
+    * TIMEZONE returns it. OpenEdge does this for every offset {@code dtz_now.p} tries.
+    */
+   @Test
+   public void nowCarriesSessionOffset()
+   {
+      List<String> failures = new ArrayList<>();
+      for (String id : new String[] { "Europe/Bucharest", "Africa/Casablanca" })
+      {
+         TimeZone.setDefault(TimeZone.getTimeZone(id));
+         for (int offset : SESSION_OFFSETS)
+         {
+            date.setTimeZone(new integer(offset));
+
+            long before = System.currentTimeMillis();
+            datetimetz now = datetimetz.now();
+            long after = System.currentTimeMillis();
+
+            long instant = instantOf(now);
+            int timezone = date.getDefaultTimeZoneOffset().intValue();
+            if (instant < before - SLACK_MS || instant > after + SLACK_MS ||
+                now.getOffset() != offset ||
+                timezone != offset)
+            {
+               failures.add(id + " session " + offset + ": instant off by " + (instant - before) +
+                            " ms, TIMEZONE(NOW) " + now.getOffset() + ", TIMEZONE " + timezone);
+            }
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} set, the DATETIME form of NOW (MTIME, {@code INIT NOW}, NOW compared with
+    * a DATETIME), MTIME and TODAY follow the session zone's wall clock, as in OpenEdge.
+    */
+   @Test
+   public void datetimeNowMtimeAndTodayFollowSessionZone()
+   {
+      List<String> failures = new ArrayList<>();
+      TimeZone.setDefault(TimeZone.getTimeZone("Europe/Bucharest"));
+      for (int offset : SESSION_OFFSETS)
+      {
+         date.setTimeZone(new integer(offset));
+
+         long before = System.currentTimeMillis() + offset * MS_PER_MINUTE;
+         datetime now = datetime.now();
+         long mtime = datetime.millisecondsSinceMidnight().longValue();
+         date today = date.today();
+         long after = System.currentTimeMillis() + offset * MS_PER_MINUTE;
+
+         long wall = localMillisOf(now);
+         if (wall < before - SLACK_MS || wall > after + SLACK_MS)
+         {
+            failures.add("session " + offset + ": datetime.now() off by " + (wall - before) + " ms");
+         }
+         if (todDistance(mtime, Math.floorMod(before, date.MILLIS_PER_DAY)) > SLACK_MS &&
+             todDistance(mtime, Math.floorMod(after, date.MILLIS_PER_DAY)) > SLACK_MS)
+         {
+            failures.add("session " + offset + ": MTIME off by " +
+                         (mtime - Math.floorMod(before, date.MILLIS_PER_DAY)) + " ms");
+         }
+         if (today.longValue() != dayNumber(before) && today.longValue() != dayNumber(after))
+         {
+            failures.add("session " + offset + ": TODAY " + today.longValue() + " instead of " +
+                         dayNumber(before));
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} set, TIME follows the session zone's wall clock, as in OpenEdge.
+    */
+   @Test
+   public void timeFollowsSessionZone()
+   {
+      List<String> failures = new ArrayList<>();
+      TimeZone.setDefault(TimeZone.getTimeZone("Europe/Bucharest"));
+      for (int offset : SESSION_OFFSETS)
+      {
+         date.setTimeZone(new integer(offset));
+
+         long shift = offset * MS_PER_MINUTE;
+         long before = Math.floorMod(System.currentTimeMillis() + shift, date.MILLIS_PER_DAY);
+         long time = date.secondsSinceMidnight().longValue();
+         long after = Math.floorMod(System.currentTimeMillis() + shift, date.MILLIS_PER_DAY);
+
+         if (todDistance(time * 1000, before) > 1000 + SLACK_MS &&
+             todDistance(time * 1000, after) > 1000 + SLACK_MS)
+         {
+            failures.add("session " + offset + ": TIME off by " + (time * 1000 - before) + " ms");
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * With {@code SESSION:TIMEZONE} set, assigning NOW to a DATETIME keeps the instant and gives the wall
+    * clock of the machine zone, not of the session zone, as in OpenEdge.
+    */
+   @Test
+   public void datetimeAssignedFromNowUsesMachineZone()
+   {
+      List<String> failures = new ArrayList<>();
+      TimeZone zone = TimeZone.getTimeZone("Europe/Bucharest");
+      TimeZone.setDefault(zone);
+      for (int offset : SESSION_OFFSETS)
+      {
+         date.setTimeZone(new integer(offset));
+
+         long before = wallClock(zone, System.currentTimeMillis());
+         datetime assigned = new datetime();
+         assigned.assign(datetimetz.now());
+         long after = wallClock(zone, System.currentTimeMillis());
+
+         long wall = localMillisOf(assigned);
+         if (wall < before - SLACK_MS || wall > after + SLACK_MS)
+         {
+            failures.add("session " + offset + ": DATETIME = NOW off by " + (wall - before) + " ms");
+         }
+      }
+      assertEquals(Collections.emptyList(), failures);
+   }
+
+   /**
+    * NOW for a given instant takes its offset, day and time from that instant: across the DST changes of
+    * 2026 (Europe/Bucharest whole hour, Australia/Lord_Howe 30 minutes), across midnight (2025-11-10), and
+    * with SESSION:TIMEZONE set to -840 and 345.
+    */
+   @Test
+   public void nowAtUsesOneInstant()
+   {
+      TimeZone.setDefault(TimeZone.getTimeZone("Europe/Bucharest"));
+      assertEquals("2461130/10799999/120", parts(datetimetz.nowAt(1774745999999L)));
+      assertEquals("2461130/14400000/180", parts(datetimetz.nowAt(1774746000000L)));
+      assertEquals("2461340/14399999/180", parts(datetimetz.nowAt(1792889999999L)));
+      assertEquals("2461340/10800000/120", parts(datetimetz.nowAt(1792890000000L)));
+      assertEquals("2460991/86399999/120", parts(datetimetz.nowAt(1762811999999L)));
+      assertEquals("2460992/0/120",        parts(datetimetz.nowAt(1762812000000L)));
+      assertEquals("2461340/10800000",     parts(datetime.nowAt(1792890000000L)));
+
+      TimeZone.setDefault(TimeZone.getTimeZone("Australia/Lord_Howe"));
+      assertEquals("2461137/7199999/660", parts(datetimetz.nowAt(1775314799999L)));
+      assertEquals("2461137/5400000/630", parts(datetimetz.nowAt(1775314800000L)));
+      assertEquals("2461319/7199999/630", parts(datetimetz.nowAt(1791041399999L)));
+      assertEquals("2461319/9000000/660", parts(datetimetz.nowAt(1791041400000L)));
+
+      date.setTimeZone(new integer(-840));
+      assertEquals("2460991/28800000/-840", parts(datetimetz.nowAt(1762812000000L)));
+      assertEquals("2460991/28800000",      parts(datetime.nowAt(1762812000000L)));
+      date.setTimeZone(new integer(345));
+      assertEquals("2460992/13500000/345",  parts(datetimetz.nowAt(1762812000000L)));
+   }
+
+   /**
+    * NOW for a fixed instant (2025-11-10T22:00:00Z) carries the real offset of zones whose raw offset plus
+    * DST savings differs from it, and the wall clock of that offset; TIMEZONE agrees with it.
+    */
+   @Test
+   public void nowAtUsesRealOffsetInIrregularDstZones()
+   {
+      long utc = 1762812000000L;
+      TimeZone.setDefault(TimeZone.getTimeZone("Africa/Casablanca"));
+      assertEquals("2460991/82800000/60", parts(datetimetz.nowAt(utc)));
+      assertEquals("2460991/82800000",    parts(datetime.nowAt(utc)));
+      assertEquals(60,                    date.currentOffset(utc));
+
+      TimeZone.setDefault(TimeZone.getTimeZone("Africa/El_Aaiun"));
+      assertEquals("2460991/82800000/60", parts(datetimetz.nowAt(utc)));
+
+      TimeZone.setDefault(TimeZone.getTimeZone("Africa/Windhoek"));
+      assertEquals("2460992/0/120", parts(datetimetz.nowAt(utc)));
+      assertEquals("2460992/0",     parts(datetime.nowAt(utc)));
+      assertEquals(120,             date.currentOffset(utc));
+   }
+
+   /**
+    * Gets the day number, time and, for a datetime-tz, offset of a value.
+    *
+    * @param    value
+    *           The value.
+    *
+    * @return   {@code day/time} or {@code day/time/offset}.
+    */
+   private static String parts(datetime value)
+   {
+      String text = value.longValue() + "/" + value.getTime();
+      return value instanceof datetimetz ? text + "/" + ((datetimetz) value).getOffset() : text;
+   }
+
+   /**
+    * Gets the instant a datetime-tz value stands for.
+    *
+    * @param    value
+    *           The value.
+    *
+    * @return   Milliseconds since the Java epoch, UTC.
+    */
+   private static long instantOf(datetimetz value)
+   {
+      return localMillisOf(value) - value.getOffset() * MS_PER_MINUTE;
+   }
+
+   /**
+    * Gets the wall clock a datetime value holds, as milliseconds since the Java epoch in its own zone.
+    *
+    * @param    value
+    *           The value.
+    *
+    * @return   The day number and time of day of the value, in milliseconds.
+    */
+   private static long localMillisOf(datetime value)
+   {
+      return (value.longValue() - date.JULIAN_EPOCH_OFFSET) * date.MILLIS_PER_DAY + value.getTime();
+   }
+
+   /**
+    * Gets the wall clock of a zone at an instant, by the JDK's zone rules.
+    *
+    * @param    zone
+    *           The zone.
+    * @param    utc
+    *           The instant, in milliseconds since the Java epoch.
+    *
+    * @return   The wall clock, in milliseconds since the Java epoch in that zone.
+    */
+   private static long wallClock(TimeZone zone, long utc)
+   {
+      return utc + zone.getOffset(utc);
+   }
+
+   /**
+    * Gets the 4GL day number of a wall clock.
+    *
+    * @param    local
+    *           The wall clock, in milliseconds since the Java epoch.
+    *
+    * @return   The day number.
+    */
+   private static long dayNumber(long local)
+   {
+      return Math.floorDiv(local, date.MILLIS_PER_DAY) + date.JULIAN_EPOCH_OFFSET;
+   }
+
+   /**
+    * Gets the distance between two times of day, across midnight.
+    *
+    * @param    a
+    *           Milliseconds of the day.
+    * @param    b
+    *           Milliseconds of the day.
+    *
+    * @return   The distance in milliseconds, at most half a day.
+    */
+   private static long todDistance(long a, long b)
+   {
+      long d = Math.floorMod(a - b, date.MILLIS_PER_DAY);
+      return Math.min(d, date.MILLIS_PER_DAY - d);
+   }
+}
