Toon posts:

tijd aanpassen binnen Unix

Pagina: 1
Acties:
  • 56 views sinds 30-01-2008

Verwijderd

Topicstarter
Hoe kan ik binnen Unix mijn tijd aanpassen. :'(
Hij staat namelijk 1 kwartiertje voor.

:?

Alvast bedankt

  • active2
  • Registratie: Juni 2001
  • Laatst online: 17-07 21:56

active2

Google is your friend

Je kunt dat met date doen!

Ik weet niet wat het precieze commando is! Moet je maar even in de manpage van date kijken!

Ik vergeet telkens hoe je die tijd moet aanpassen :( Daarom laat ik het over het algemeen maar zo als het nu is!

Google, Het mirakel van de 21e eeuw!!!!


Verwijderd

Topicstarter
UHM... Ik ben een leek wat betreft UNIX.
Moet ik me schamen als ik dat niet eens weet wat 'manpage' is. |:(

Please help me god.
Op dinsdag 19 maart 2002 11:05 schreef active2 het volgende:
Je kunt dat met date doen!

Ik weet niet wat het precieze commando is! Moet je maar even in de manpage van date kijken!

Ik vergeet telkens hoe je die tijd moet aanpassen :( Daarom laat ik het over het algemeen maar zo als het nu is!

Verwijderd

tik in : man date :P

  • Gertjan
  • Registratie: Oktober 2001
  • Laatst online: 19-06 22:04

Gertjan

mmmm, beer...

Hm, man date geeft bij mij aan dat er geen manual entry is voor date (Linux, Slackware 8.0), ook date -h doet het niet en date geeft netjes de datum en tijd weer. De tijd die overigens ook bij mij niet goed staat, dus als iemand uit kan leggen hoe je dat kan doen zonder te rebooten...
Het kan namelijk ook door gewoon de pc te rebooten en in je bios de tijd aan te passen, maar rebooten is niet voor iedereen een optie :)

Verwijderd

Topicstarter
Ja ja,
Ik moet het meteen 100 % goed doen. Dus ik zou graag een voorbeeld willen hebben.
We zitten namelijk op een werkplek waar veel gebruikers zitten en verbonden zijn aan de unixbak. En als dit fout gaat dan moeten we terug naar de backup. En dan krijgen we flinke stress (althans wij).

:r
Op dinsdag 19 maart 2002 11:09 schreef Courage het volgende:
tik in : man date :P

  • pistole
  • Registratie: Juli 2000
  • Laatst online: 14-08 22:52

pistole

Frutter

iets met date --set "1 jan 2002 18:45"

Ik frut, dus ik epibreer


  • kenneth
  • Registratie: September 2001
  • Niet online

kenneth

achter de duinen

Op dinsdag 19 maart 2002 11:05 schreef active2 een hoop uitroeptekens
Uitroeptekens... :X

Look, runners deal in discomfort. After you get past a certain point, that’s all there really is. There is no finesse here.


  • Gertjan
  • Registratie: Oktober 2001
  • Laatst online: 19-06 22:04

Gertjan

mmmm, beer...

Op dinsdag 19 maart 2002 11:15 schreef ruudje81 het volgende:
Ja ja,
Ik moet het meteen 100 % goed doen. Dus ik zou graag een voorbeeld willen hebben.
Met 'man <commando>' krijg je alleen maar een help te zien (als hij bestaat). Je gaat dus nog niks veranderen. Je kan ook nog proberen om '<commando> -h' of '<commando> --help' in te typen als je even kort de syntax van een commando wil zien.

Verwijderd

Als je nou gewoon man date intikt...
krijg je dit.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
date Command

Purpose

Displays or sets the date or time.

Syntax

To Set the Dateand Time as Root User

/usr/bin/date [ -n ] [ -u ] [ Date ] [ +FieldDescriptor ...
]
Redelijk duidelijk toch :?
To Displaythe Date and Time

/usr/bin/date [ -u ] [ +FieldDescriptor ... ]

Description

Attention: Do not change the date when the system is running with
more than one user.

  • Gertjan
  • Registratie: Oktober 2001
  • Laatst online: 19-06 22:04

Gertjan

mmmm, beer...

Op dinsdag 19 maart 2002 11:20 schreef Courage het volgende:
Als je nou gewoon man date intikt...
krijg je dit.
Nee hoor:
code:
1
2
3
4
root@syb:/usr/src# man date
No manual entry for date
root@syb:/usr/src# date
Tue Mar 19 11:41:33 CET 2002

:+

  • TrailBlazer
  • Registratie: Oktober 2000
  • Laatst online: 14:03

TrailBlazer

Karnemelk FTW

rebooten en in bios aanpassen werkt ook altijd goed. :P is echt de noob methode (vaak toegepast in jonge linux jaren) Je moet ook root zijn om tijd aan te mogen passen met het date commando

Verwijderd

Topicstarter
Dus wat je eigenlijk wilt zeggen "laat dat kwartiertje maar zitten".
We zijn met +/- 60 gebruikers ingelogd.

Maar kan niemand mij de exacte commando geven. please.. *D
Op dinsdag 19 maart 2002 11:20 schreef Courage het volgende:
Als je nou gewoon man date intikt...
krijg je dit.
code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
date Command

Purpose

Displays or sets the date or time.

Syntax

To Set the Dateand Time as Root User

/usr/bin/date [ -n ] [ -u ] [ Date ] [ +FieldDescriptor ...
]
Redelijk duidelijk toch :?
To Displaythe Date and Time

/usr/bin/date [ -u ] [ +FieldDescriptor ... ]

Description

Attention: Do not change the date when the system is running with
more than one user.

  • TrailBlazer
  • Registratie: Oktober 2000
  • Laatst online: 14:03

TrailBlazer

Karnemelk FTW

code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
LANIvsb eelcon 17 > more date
 
 
 
date(1)          User Commands           date(1)
 
 
 
NAME
     date - write the date and time
 
SYNOPSIS
     /usr/bin/date [-u] [+format]
     /usr/bin/date [-a [-]sss.fff]
     /usr/bin/date [-u] [[mmdd]HHMM | mmddHHMM[cc]yy][.SS]
 
     /usr/xpg4/bin/date [-u] [+format]
     /usr/xpg4/bin/date [-a [-]sss.fff]
     /usr/xpg4/bin/date [-u] [[mmdd]HHMM | mmddHHMM[cc]yy][.SS]
 
AVAILABILITY
  /usr/bin/date
     SUNWcsu
 
  /usr/xpg4/bin/date
     SUNWxcu4
 
DESCRIPTION
     The date utility writes the date and time to standard output
     or  attempts  to  set the system date and time.  By default,
     the current date and time will be written.
 
     Specifications of native language translations of month  and
     weekday  names  are  supported.  The month and weekday names
     used for a language are based on the locale specified by the
     environment variable LC_TIME; see environ(5).
 
     The following is the default form for the "C" locale:
 
        %a %b %e %T %Z %Y
 
     for example,
 
        Fri Dec 23 10:10:42 EST 1988
 
OPTIONS
     The following options are supported:
 
     -a [-]sss.fff
             Slowly adjust the time by sss.fff  seconds  (fff
             represents fractions of a second).  This adjust-
             ment can be positive or negative.  The  system's
             clock  will  be  sped up or slowed down until it
             has drifted by the number of seconds specified.
 
     -u     Display (or set) the date in Greenwich Mean Time
             (GMT-universal   time),   bypassing  the  normal
             conversion to (or from) local time.
 
 
 
 
 
SunOS 5.5.1    Last change: 15 Sep 1995           1
 
 
 
 
 
 
date(1)          User Commands           date(1)
 
 
 
OPERANDS
     The following operands are supported:
 
     +format     If the argument begins with  +,  the  output  of
             date  is  the  result  of passing format and the
             current  time  to  strftime().   date  uses  the
             conversion    specifications   listed   on   the
             strftime(3C) manual page,  with  the  conversion
             specification   for  %C  determined  by  whether
             /usr/bin/date or /usr/xpg4/bin/date is used:
 
             /usr/bin/date     Locale's   date    and    time
                         representation.   This  is the
                         default output for date.
 
             /usr/xpg4/bin/date
                         Century (a year divided by 100
                         and  truncated  to an integer)
                         as a decimal number [00-99].
 
             The string is always terminated with a  NEWLINE.
             An  argument  containing  blanks must be quoted;
             see the EXAMPLES section.
 
     mm     Month number
     dd     Day number in the month
     HH     Hour number (24 hour system)
     MM     Minute number
     SS     Second number
     cc     Century minus one
     yy     Last 2 digits of the year number
 
             The month, day, year, and century may  be  omit-
             ted; the current values are applied as defaults.
             For example:
 
                 date 10080045
 
             sets the date to Oct 8, 12:45 a.m.  The  current
             year is the default because no year is supplied.
             The system operates in GMT.  date takes care  of
             the  conversion  to  and from local standard and
             daylight time.  Only the super-user  may  change
             the  date.   After successfully setting the date
             and time, date displays the new  date  according
             to the default format.  The date command uses TZ
             to determine the correct time zone  information;
             see environ(5).
 
EXAMPLES
     The command
 
 
 
 
SunOS 5.5.1    Last change: 15 Sep 1995           2
 
 
 
 
 
 
date(1)          User Commands           date(1)
 
 
 
        example% date '+DATE: %m/%d/%y%nTIME: %H:%M:%S'
 
     generates as output:
 
        DATE: 08/01/76
        TIME: 14:45:05
     The command
 
        example# date 1234.56
 
     sets the current time to 12:34:56.
 
ENVIRONMENT
     See environ(5) for descriptions of the following environment
     variables  that  affect  the  execution  of date:  LC_CTYPE,
     LC_TIME, LC_MESSAGES, and NLSPATH.
 
     TZ     Determine the timezone in  which  the  time  and
             date are written, unless the -u option is speci-
             fied.  If the TZ variable is not set and the  -u
             is not specified, the system default timezone is
             used.
 
EXIT STATUS
     The following exit values are returned:
     0     Successful completion.
     >0   An error occurred.
 
SEE ALSO
     strftime(3C), environ(5)
 
DIAGNOSTICS
     no permission   You are not the super-user and you tried
                 to change the date.
     bad conversion The date set is syntactically incorrect.
 
NOTES
     If you attempt to set the current date to one of  the  dates
     that the standard and alternate time zones change (for exam-
     ple, the date that daylight time is starting or ending), and
     you  attempt  to  set  the  time  to  a time in the interval
     between the end of standard time and the  beginning  of  the
     alternate  time  (or  the  end of the alternate time and the
     beginning of standard time), the results are unpredictable.
 
 
 
 
 
 
 
 
 
 
 
SunOS 5.5.1    Last change: 15 Sep 1995           3
 
 
 
LANIvsb eelcon 18 >

Lief ben ik he :)

  • Gertjan
  • Registratie: Oktober 2001
  • Laatst online: 19-06 22:04

Gertjan

mmmm, beer...

Op dinsdag 19 maart 2002 11:26 schreef ruudje81 het volgende:
Maar kan niemand mij de exacte commando geven. please.. *D
Ja ehm, je kan ook wel wat zelf uitvinden toch... Maar ok, omdat ik in een goede bui ben (net tentamen ingekopt :D):

date -s "19 mar 2002 11:32"

pas natuurlijk wel ff de tijd goed aan :P

/edit
enje moet natuurlijk wel als root ingelogd zijn om de tijd te mogen veranderen

Verwijderd

Topicstarter
Hehe,
het is gelukt ondanks de vele ingelogde gebruikers (64 users).
IK BEN BLIJ B-), VROLIJK en heb weer zin om door te leven :z .

Thnx...
8-)

  • Terror
  • Registratie: Juni 1999
  • Laatst online: 17:04
Als die bak op i-net(zal wel niet) staat aangesloten, kan je met ntp gaan werken. Heb je er helemaal geen omkijken meer naar.

Dell XPS M1530 (Red) | T8300 | 4 GB | 750 GB 7200 rpm | 8600m GT | Wifi N | 1440x900 LG | 9 Cells | Windows 8.1 Pro x64


  • Jordi
  • Registratie: Januari 2000
  • Niet online

Jordi

#1#1

Mja... dit had je echt zelf wel uit kunnen vinden met de manpages e.d.... :{

Het zal wel niet, maar het zou maar wel.

Pagina: 1

Dit topic is gesloten.