datumnotatie in NL
'k Gebruik onderstaand script. Nu toont hij alleen alles in het engels. Terwijl ik graag de datum in het nederlands wil. Hoe doe ik dit precies? Ik heb al een scriptje gevonden maar geen idee hoe het samengevoegd moet worden.
hier het datumnotatiescript
Code (php)
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
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
<?php
<select name="date">
<option value="<? echo "$settings[date]"; ?>">
[code]<? $today = date("$settings[date]"); echo "$today"; ?>
</option>
<option value="F j, Y">
<? $today = date("F j, Y"); echo "$today"; ?>
</option>
<option value="F j, Y, g:i a">
<? $today = date("F j, Y, g:i a"); echo "$today"; ?>
</option>
<option value="F j, Y, G:i">
<? $today = date("F j, Y, G:i"); echo "$today"; ?>
</option>
<option value="D M j Y">
<? $today = date("D M j Y"); echo "$today"; ?>
</option>
<option value="D j F Y">
<? $today = date("D j F Y"); echo "$today"; ?>
</option>
<option value="D M j Y G:i:s">
<? $today = date("D M j Y G:i:s"); echo "$today"; ?>
</option>
<option value="m d Y">
<? $today = date("m d Y"); echo "$today"; ?>
</option>
<option value="d m Y">
<? $today = date("d m Y"); echo "$today"; ?>
</option>
<option value="m d Y, G:i">
<? $today = date("m d Y, G:i"); echo "$today"; ?>
</option>
<option value="d m Y, G:i">
<? $today = date("d m Y, G:i"); echo "$today"; ?>
</option>
?>
<select name="date">
<option value="<? echo "$settings[date]"; ?>">
[code]<? $today = date("$settings[date]"); echo "$today"; ?>
</option>
<option value="F j, Y">
<? $today = date("F j, Y"); echo "$today"; ?>
</option>
<option value="F j, Y, g:i a">
<? $today = date("F j, Y, g:i a"); echo "$today"; ?>
</option>
<option value="F j, Y, G:i">
<? $today = date("F j, Y, G:i"); echo "$today"; ?>
</option>
<option value="D M j Y">
<? $today = date("D M j Y"); echo "$today"; ?>
</option>
<option value="D j F Y">
<? $today = date("D j F Y"); echo "$today"; ?>
</option>
<option value="D M j Y G:i:s">
<? $today = date("D M j Y G:i:s"); echo "$today"; ?>
</option>
<option value="m d Y">
<? $today = date("m d Y"); echo "$today"; ?>
</option>
<option value="d m Y">
<? $today = date("d m Y"); echo "$today"; ?>
</option>
<option value="m d Y, G:i">
<? $today = date("m d Y, G:i"); echo "$today"; ?>
</option>
<option value="d m Y, G:i">
<? $today = date("d m Y, G:i"); echo "$today"; ?>
</option>
?>
en hier een datumnotatiescript in het nederlands
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
2
3
4
5
6
7
8
9
10
11
12
13
<?php
function transform_date ($tag, $time)
{
$maanden_nl = Array ("","Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
$dagen_nl = Array ("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");
$date = date ($tag, $time);
$date = ereg_replace ("x", $dagen_nl[date("w", $time)], $date);
$date = ereg_replace ("X", $maanden_nl[date ("n", $time)], $date);
return $date;
}
echo transform_date ("x j X Y H:i", time());
?>
function transform_date ($tag, $time)
{
$maanden_nl = Array ("","Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
$dagen_nl = Array ("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");
$date = date ($tag, $time);
$date = ereg_replace ("x", $dagen_nl[date("w", $time)], $date);
$date = ereg_replace ("X", $maanden_nl[date ("n", $time)], $date);
return $date;
}
echo transform_date ("x j X Y H:i", time());
?>
Gewijzigd op 01/01/1970 01:00:00 door Nancy
Mijn hosting staat dat niet toe.
Hun zeggen dat het via .httacces moet.
via .htacces php??
denk het geen idee eigenlijk.. enige manier die ik ken, is d.m.v php scriptjes hierboven te combineren
Rafael:
Dit werkt niet op elke server.
Wat wel altijd werkt is om het gewoon in een array om te zetten. 'vertalen'
Probleem is alleen dat ik geen idee heb hoe die 2 samen te voegen.
Code (php)
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
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
<?php
function transform_date ($tag, $time) {
$maanden_nl = Array ("","Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
$dagen_nl = Array ("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");
$date = date ($tag, $time);
$date = ereg_replace ("x", $dagen_nl[date("w", $time)], $date);
$date = ereg_replace ("X", $maanden_nl[date ("n", $time)], $date);
return $date;
}
?>
<select name="date">
<option value="<? echo "$settings[date]"; ?>">
<? $today = date("$settings[date]"); echo "$today"; ?>
</option>
<option value="F j, Y">
<? $today = transform_date("X j, Y", time()); echo "$today"; ?>
</option>
<option value="F j, Y, g:i a">
<? $today = transform_date("X j, Y, g:i a", time()); echo "$today"; ?>
</option>
<option value="F j, Y, G:i">
<? $today = transform_date("X j, Y, G:i", time()); echo "$today"; ?>
</option>
<option value="D M j Y">
<? $today = transform_date("x X j Y", time()); echo "$today"; ?>
</option>
<option value="D j F Y">
<? $today = transform_date("x j X Y", time()); echo "$today"; ?>
</option>
<option value="D M j Y G:i:s">
<? $today = transform_date("x X j Y G:i:s", time()); echo "$today"; ?>
</option>
<option value="m d Y">
<? $today = transform_date("m x Y", time()); echo "$today"; ?>
</option>
<option value="d m Y">
<? $today = transform_date("x m Y", time()); echo "$today"; ?>
</option>
<option value="m d Y, G:i">
<? $today = transform_date("m x Y, G:i", time()); echo "$today"; ?>
</option>
<option value="d m Y, G:i">
<? $today = transform_date("d x Y, G:i", time()); echo "$today"; ?>
</option>
</select>
function transform_date ($tag, $time) {
$maanden_nl = Array ("","Januari","Februari","Maart","April","Mei","Juni","Juli","Augustus","September","Oktober","November","December");
$dagen_nl = Array ("Zondag","Maandag","Dinsdag","Woensdag","Donderdag","Vrijdag","Zaterdag");
$date = date ($tag, $time);
$date = ereg_replace ("x", $dagen_nl[date("w", $time)], $date);
$date = ereg_replace ("X", $maanden_nl[date ("n", $time)], $date);
return $date;
}
?>
<select name="date">
<option value="<? echo "$settings[date]"; ?>">
<? $today = date("$settings[date]"); echo "$today"; ?>
</option>
<option value="F j, Y">
<? $today = transform_date("X j, Y", time()); echo "$today"; ?>
</option>
<option value="F j, Y, g:i a">
<? $today = transform_date("X j, Y, g:i a", time()); echo "$today"; ?>
</option>
<option value="F j, Y, G:i">
<? $today = transform_date("X j, Y, G:i", time()); echo "$today"; ?>
</option>
<option value="D M j Y">
<? $today = transform_date("x X j Y", time()); echo "$today"; ?>
</option>
<option value="D j F Y">
<? $today = transform_date("x j X Y", time()); echo "$today"; ?>
</option>
<option value="D M j Y G:i:s">
<? $today = transform_date("x X j Y G:i:s", time()); echo "$today"; ?>
</option>
<option value="m d Y">
<? $today = transform_date("m x Y", time()); echo "$today"; ?>
</option>
<option value="d m Y">
<? $today = transform_date("x m Y", time()); echo "$today"; ?>
</option>
<option value="m d Y, G:i">
<? $today = transform_date("m x Y, G:i", time()); echo "$today"; ?>
</option>
<option value="d m Y, G:i">
<? $today = transform_date("d x Y, G:i", time()); echo "$today"; ?>
</option>
</select>
Kijk hier voor een werkend voorbeeld.
edit: foutje verwijderd
Gewijzigd op 01/01/1970 01:00:00 door Jan Koehoorn