PageSourceSearch

https://jurdefinans.com/t/v212/images/mydate.js

js jurdefinans.com collected 2026-10-08 14:19:57 UTC 1,919 bytes, 61 lines download raw bytes

1/*	%D - день недели
2* 	%d - число
3* 	%M - месяц
4* 	%y - год
5* 	%Y - короткий год
6* 	%h - час
7* 	%m - минута
8* 	%s - секунда
9* 	~xxxxxx~ - мерцающие символы
10*/
11
12
13function myDate(id, shift) {	
14	try {
15		var days = ['воскресенье', 'понедельник', 'вторник', 'среда', 'четверг', 'пятница', 'суббота'],
16			months = ['января', 'февраля', 'марта', 'апреля', 'мая', 'июня', 'июля', 'августа', 'сентября', 'октября', 'ноября', 'декабря'],
17			obj = document.getElementById(id),
18			format = obj.innerHTML;
19			
20		function update() {
21			var date = new Date(), hours = date.getHours();
22			
23			if (shift == undefined) {
24				shift = hours - date.getUTCHours() + ((date.getDate() - date.getUTCDate())*24);
25			}
26					
27			date.setUTCHours(date.getUTCHours() + shift);
28			var D = days[date.getUTCDay()],
29				d = date.getUTCDate(),
30				M = months[date.getUTCMonth()],
31				y = date.getUTCFullYear(),
32				h = date.getUTCHours(),
33				m = date.getUTCMinutes(),
34				s = date.getUTCSeconds(),
35				year = y.toString(),
36				Y = year[2] + year[3],
37				wrap = (s % 2 == 1)? '<span style="visibility:hidden">' : '<span>';
38			if (h < 10) h = '0' + h;
39			if (m < 10) m = '0' + m;
40			if (s < 10) s = '0' + s;
41			obj.innerHTML = format
42				.replace(/%D/g, D)
43				.replace(/%d/g, d)
44				.replace(/%M/g, M)
45				.replace(/%Y/g, Y)
46				.replace(/%y/g, y)
47				.replace(/%h/g, h)
48				.replace(/%m/g, m)
49				.replace(/%s/g, s)
50				.replace(/~([^~]+)~/g, wrap + '$1</span>');
51		}
52		update();
53		window.setInterval(update, 1000);	
54	} catch(e) {
55		
56	}
57};
58
59/*******************************************/
60
61myDate('date'); // Время в часовом поясе пользователя - в элемент с id=date

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.