Skip to main content

Nguva ne Zuva

ShonaScript inogona kukuradzidza nguva kana zuva mu terminal.

Nguva#

Kana uchida kuona kuti inguvai uchishandisa ShonaScript, unogadzira variable yenguva seizvi:

nguva = Nguvanyora(nguva)
Ita

Mu Application ye ShonaScript

  1. nyora code iyoyi
  2. baya bhatani re round riri pazasi pe screen

Kana kuti

Mu VS Code

Nyora code iyoyi mu index.shona, wochiita izvi:

  1. mu terminal, nyora kuti: node shona.js wobaya enter

  2. mu terminal, nyora kuti: node index.js wobaya enter

Ukaita izvi unofana kuona mu terminal nguva dzacho sokuti 11:02:10 AM

Zuva#

Kana uchida kuona kuti inguvai uchishandisa ShonaScript, unogadzira variable yenguva seizvi:

zuvaRanhasi = Zuvanyora(zuvaRanhasi)
Ita

Mu Application ye ShonaScript

  1. nyora code iyoyi
  2. baya bhatani re round riri pazasi pe screen

Kana kuti

Mu VS Code

Nyora code iyoyi mu index.shona, wochiita izvi:

  1. mu terminal, nyora kuti: node shona.js wobaya enter

  2. mu terminal, nyora kuti: node index.js wobaya enter

Ukaita izvi unofana kuona mu terminal zuva ranhasi racho sokuti 11/21/2021. Zuva iri rinogona kunyorwa zvakasiyana neizvi zvichienderana ne computer yaukushandisa

Kana wave kuziva zvema functions, uchazogadzira function inoita kuti unyore nguva muterminal ichiverenga ma seconds