diff --git a/source/dub/internal/sdlang/lexer.d b/source/dub/internal/sdlang/lexer.d index 027b84924..9b654535f 100644 --- a/source/dub/internal/sdlang/lexer.d +++ b/source/dub/internal/sdlang/lexer.d @@ -1260,15 +1260,20 @@ class Lexer else { auto timezone = new immutable SimpleTimeZone(offset.get()); - mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, dateTimeFrac.fracSecs, timezone)")); + static if (__VERSION__ >= 2067) auto fsecs = dateTimeFrac.fracSecs; + else auto fsecs = FracSec.from!"hnsecs"(dateTimeFrac.fracSecs.total!"hnsecs"); + mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, fsecs, timezone)")); } } try { auto timezone = TimeZone.getTimeZone(timezoneStr); - if(timezone) - mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, dateTimeFrac.fracSecs, timezone)")); + if(timezone) { + static if (__VERSION__ >= 2067) auto fsecs = dateTimeFrac.fracSecs; + else auto fsecs = FracSec.from!"hnsecs"(dateTimeFrac.fracSecs.total!"hnsecs"); + mixin(accept!("Value", "SysTime(dateTimeFrac.dateTime, fsecs, timezone)")); + } } catch(TimeException e) { diff --git a/source/dub/internal/sdlang/token.d b/source/dub/internal/sdlang/token.d index 6be134e6d..5ef895368 100644 --- a/source/dub/internal/sdlang/token.d +++ b/source/dub/internal/sdlang/token.d @@ -22,6 +22,9 @@ import dub.internal.sdlang.util; /// So this is needed for any SDL "Date Time" that doesn't include a time zone. struct DateTimeFrac { + this(DateTime dt, Duration fs) { this.dateTime = dt; this.fracSecs = fs; } + this(DateTime dt, FracSec fs) { this.dateTime = dt; this.fracSecs = fs.hnsecs.hnsecs; } + DateTime dateTime; Duration fracSecs; deprecated("Use fracSecs instead.") {