Skip to content

Question: TimeZone #118

@0xIO32

Description

@0xIO32

Here it converts the javascript "Date" object into the untis format as string:

WebUntis/src/base.ts

Lines 803 to 814 in 51576aa

/**
* Convert a JS Date Object to a WebUntis date string
* @param {Date} date
* @returns {String}
*/
static convertDateToUntis(date: Date): string {
return (
date.getFullYear().toString() +
(date.getMonth() + 1 < 10 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1).toString() +
(date.getDate() < 10 ? '0' + date.getDate() : date.getDate()).toString()
);
}

"Date" in javascript uses the local time, not utc. Afaik, I haven't seen a timezone being transmitted to webuntis.

Is the timezone assuming utc or is the timezone set by the school?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions