-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclass2_2.js
22 lines (20 loc) · 934 Bytes
/
class2_2.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const firstName = "Cristina";
const lastName = "Rits";
const dateInfo = require("./date_et");
const timeInfo = require("./time_et");
console.log("Programmi autor on: " + firstName + " " + lastName);
function dateETformatted(){
const monthNamesET = ["jaanuar", "veerbuar", "märts", "aprill", "mai", "juuni", "juuli", "august", "september", "oktoober", "november", "detsember"];
//console.log(monthNamesET[1]);
let timeNow = new Date();
//console.log(Date());
let dateNow = timeNow.getDate();
let monthNow = timeNow.getMonth();
let yearNow = timeNow.getFullYear();
//let dateET = dateNow + "." + (monthNow + 1) + "." + yearNow;
let dateET = dateNow + ". " + monthNamesET[monthNow] + " " + yearNow;
return dateET;
}
let dateETNow = dateETformatted(); //funktsiooni käima panemine
console.log("Täna on: " + dateETNow);
console.log("Täna on tõesti " + dateETformatted());