Skip to content

Commit

Permalink
Deprecation updates for datetime and fromTimestamp (#2410)
Browse files Browse the repository at this point in the history
* Update datetime to dateTime

* Update fromTimestamp to createFromTimestamp
  • Loading branch information
bmcdonald3 committed May 4, 2023
1 parent 8f93f9b commit a6629af
Show file tree
Hide file tree
Showing 5 changed files with 279 additions and 279 deletions.
2 changes: 1 addition & 1 deletion src/Logging.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ module Logging {
}

proc generateDateTimeString() throws {
var dts = datetime.now():string;
var dts = dateTime.now():string;
var vals = dts.split("T");
var cd = vals(0);
var rawCms = vals(1).split(".");
Expand Down
10 changes: 5 additions & 5 deletions src/MetricsMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -519,12 +519,12 @@ module MetricsMsg {
var name: string;
var category: MetricCategory;
var scope: MetricScope;
var timestamp: datetime;
var timestamp: dateTime;
var value: real;

proc init(name: string, category: MetricCategory,
scope: MetricScope=MetricScope.GLOBAL,
timestamp: datetime=datetime.now(),
timestamp: dateTime=dateTime.now(),
value: real) {
this.name = name;
this.category = category;
Expand All @@ -540,7 +540,7 @@ module MetricsMsg {

proc init(name: string, category: MetricCategory,
scope: MetricScope=MetricScope.USER,
timestamp: datetime=datetime.now(),
timestamp: dateTime=dateTime.now(),
value: real,
user: string) {

Expand All @@ -562,7 +562,7 @@ module MetricsMsg {
proc init(name: string,
category: MetricCategory,
scope: MetricScope=MetricScope.GLOBAL,
timestamp: datetime=datetime.now(),
timestamp: dateTime=dateTime.now(),
value: real,
cmd: string,
dType: DType,
Expand Down Expand Up @@ -612,7 +612,7 @@ module MetricsMsg {

proc init(name: string, category: MetricCategory,
scope: MetricScope=MetricScope.LOCALE,
timestamp: datetime=datetime.now(),
timestamp: dateTime=dateTime.now(),
value: real,
locale_num: int,
locale_name: string,
Expand Down
2 changes: 1 addition & 1 deletion src/TimeClassMsg.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ module TimeClassMsg {

forall (v, y, m, d, iso_y, is_ly, woy, doy, dow) in zip(valuesEntry.a, year, month, day, isoYear, is_leap_year, weekOfYear, dayOfYear, dayOfWeek) {
// convert to seconds and create date
var t = date.fromTimestamp(floorDivisionHelper(v, 10**9):int);
var t = date.createFromTimestamp(floorDivisionHelper(v, 10**9):int);
(y, m, d, (iso_y, woy, dow)) = (t.year, t.month, t.day, t.isoCalendar());
dow -= 1;
is_ly = isLeapYear(y);
Expand Down
Loading

0 comments on commit a6629af

Please sign in to comment.