Skip to content

Commit 3cc87cf

Browse files
committed
translated until line 206
1 parent 284a9bc commit 3cc87cf

File tree

1 file changed

+27
-27
lines changed

1 file changed

+27
-27
lines changed

1-js/05-data-types/11-date/article.md

Lines changed: 27 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -108,34 +108,34 @@ Există de asemenea omologii lor UTC, care returnează ziua, luna, anul și așa
108108
Dacă fusul orar local este decalat față de UTC, atunci codul de mai jos afișează ore diferite:
109109
110110
```js run
111-
// current date
111+
// data curentă
112112
let date = new Date();
113113
114-
// the hour in your current time zone
114+
// ora în fusul vostru orar
115115
alert( date.getHours() );
116116
117-
// the hour in UTC+0 time zone (London time without daylight savings)
117+
// ora în fusul orar UTC+0 (ora Londrei fără ora de vară)
118118
alert( date.getUTCHours() );
119119
```
120120

121-
Besides the given methods, there are two special ones that do not have a UTC-variant:
121+
În afară de metodele date, există două metode speciale care nu au o variantă UTC:
122122

123123
[getTime()](mdn:js/Date/getTime)
124-
: Returns the timestamp for the date -- a number of milliseconds passed from the January 1st of 1970 UTC+0.
124+
: Returnează timestamp-ul pentru dată -- un număr de milisecunde trecute de la 1 Ianuarie 1970 UTC+0.
125125

126126
[getTimezoneOffset()](mdn:js/Date/getTimezoneOffset)
127-
: Returns the difference between UTC and the local time zone, in minutes:
127+
: Returnează diferența dintre UTC și fusul orar local, în minute:
128128

129129
```js run
130-
// if you are in timezone UTC-1, outputs 60
131-
// if you are in timezone UTC+3, outputs -180
130+
// dacă vă aflați în fusul orar UTC-1, produce 60
131+
// dacă vă aflați în fusul orar UTC+3, produce -180
132132
alert( new Date().getTimezoneOffset() );
133133

134134
```
135135

136-
## Setting date components
136+
## Stabilirea componentelor datei
137137

138-
The following methods allow to set date/time components:
138+
Următoarele metode permit stabilirea componentelor de dată/ora:
139139

140140
- [`setFullYear(year, [month], [date])`](mdn:js/Date/setFullYear)
141141
- [`setMonth(month, [date])`](mdn:js/Date/setMonth)
@@ -144,38 +144,38 @@ The following methods allow to set date/time components:
144144
- [`setMinutes(min, [sec], [ms])`](mdn:js/Date/setMinutes)
145145
- [`setSeconds(sec, [ms])`](mdn:js/Date/setSeconds)
146146
- [`setMilliseconds(ms)`](mdn:js/Date/setMilliseconds)
147-
- [`setTime(milliseconds)`](mdn:js/Date/setTime) (sets the whole date by milliseconds since 01.01.1970 UTC)
147+
- [`setTime(milliseconds)`](mdn:js/Date/setTime) (setează întreaga dată cu milisecunde începând cu 01.01.1970 UTC)
148148

149-
Every one of them except `setTime()` has a UTC-variant, for instance: `setUTCHours()`.
149+
Fiecare dintre ele cu excepția `setTime()` au o variantă UTC, de exemplu: `setUTCHours()`.
150150

151-
As we can see, some methods can set multiple components at once, for example `setHours`. The components that are not mentioned are not modified.
151+
După cum putem vedea, unele metode pot seta mai multe componente deodată, de exemplu `setHours`. Componentele care nu sunt menționate nu sunt modificate.
152152

153-
For instance:
153+
De exemplu:
154154

155155
```js run
156156
let today = new Date();
157157

158158
today.setHours(0);
159-
alert(today); // still today, but the hour is changed to 0
159+
alert(today); // tot astăzi, dar ora este schimbată la 0
160160

161161
today.setHours(0, 0, 0, 0);
162-
alert(today); // still today, now 00:00:00 sharp.
162+
alert(today); // tot astăzi, la ora 00:00:00 fix.
163163
```
164164

165-
## Autocorrection
165+
## Autocorecție
166166

167-
The *autocorrection* is a very handy feature of `Date` objects. We can set out-of-range values, and it will auto-adjust itself.
167+
*Autocorecția* este o caracteristică foarte utilă a obiectelor `Date`. Putem seta valori în afara intervalelor, iar aceasta se va auto-ajusta.
168168

169-
For instance:
169+
De exemplu:
170170

171171
```js run
172172
let date = new Date(2013, 0, *!*32*/!*); // 32 Jan 2013 ?!?
173-
alert(date); // ...is 1st Feb 2013!
173+
alert(date); // ...este 1 Feb 2013!
174174
```
175175
176-
Out-of-range date components are distributed automatically.
176+
Componentele de date în afara intervalului sunt distribuite automat.
177177
178-
Let's say we need to increase the date "28 Feb 2016" by 2 days. It may be "2 Mar" or "1 Mar" in case of a leap-year. We don't need to think about it. Just add 2 days. The `Date` object will do the rest:
178+
Să spunem că trebuie să mărim data "28 Feb 2016" cu 2 zile. Aceasta poate fi "2 Mar" sau "1 Mar" în cazul unui an bisect. Nu trebuie să ne gândim la asta. Doar adăugăm 2 zile. Obiectul `Date` se va ocupa de restul:
179179
180180
```js run
181181
let date = new Date(2016, 1, 28);
@@ -186,24 +186,24 @@ date.setDate(date.getDate() + 2);
186186
alert( date ); // 1 Mar 2016
187187
```
188188
189-
That feature is often used to get the date after the given period of time. For instance, let's get the date for "70 seconds after now":
189+
Acea caracteristică este adesea utilizată pentru a obține data după o perioadă de timp dată. De exemplu, să obținem data pentru "70 de secunde de acum încolo":
190190
191191
```js run
192192
let date = new Date();
193193
date.setSeconds(date.getSeconds() + 70);
194194

195-
alert( date ); // shows the correct date
195+
alert( date ); // afișează data corectă
196196
```
197197
198-
We can also set zero or even negative values. For example:
198+
De asemenea putem seta valori zero sau chiar negative. De exemplu:
199199
200200
```js run
201201
let date = new Date(2016, 0, 2); // 2 Jan 2016
202202

203-
date.setDate(1); // set day 1 of month
203+
date.setDate(1); // setează ziua 1 a lunii
204204
alert( date );
205205

206-
date.setDate(0); // min day is 1, so the last day of the previous month is assumed
206+
date.setDate(0); // ziua minimă este 1, deci se presupune ultima zi a lunii precedente
207207
alert( date ); // 31 Dec 2015
208208
```
209209

0 commit comments

Comments
 (0)