Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 21:31

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



[Hilfe]Unix Timestamp auf Europe/Berlin

Discussion on [Hilfe]Unix Timestamp auf Europe/Berlin within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
lnqlorlouz's Avatar
 
elite*gold: 0
Join Date: Jun 2013
Posts: 405
Received Thanks: 84
Lightbulb [Hilfe]Unix Timestamp auf Europe/Berlin

Hallo,

ich habe folgenden Code:
PHP Code:
$server_timestamp $r['timestamp'];
        
$timestamp date("H:i | d.m.Y",($server_timestamp -60*60*24)); 
der wird aber als Unix-Timestamp ausgegeben (Amerikanische Uhrzeit), soll aber eigentlich als Europe/Berlin ausgegeben werden, aber ich bekomme es nicht hin.

Zur Info: Das sind Timestamps aus der mySQL-Datenbank.

Grüße & Danke.
lnqlorlouz is offline  
Old 04/06/2014, 23:46   #2
 
elite*gold: 22
Join Date: Feb 2012
Posts: 576
Received Thanks: 332
Quote:
/default timezone
$date = new DateTime(null);
echo 'Default timezone: '.$date->getTimestamp().'<br />'."\r\n";

//America/New_York
$date = new DateTime(null, new DateTimeZone('America/New_York'));
echo 'America/New_York: '.$date->getTimestamp().'<br />'."\r\n";

//Europe/Amsterdam
$date = new DateTime(null, new DateTimeZone('Europe/Amsterdam'));
echo 'Europe/Amsterdam: '.$date->getTimestamp().'<br />'."\r\n";
VisionEP1 is offline  
Thanks
1 User
Old 04/07/2014, 20:37   #3
 
elite*gold: 95
Join Date: Aug 2010
Posts: 2,254
Received Thanks: 279
ganz billig, wenn du das Offset in Stunden brauchst:
date("H:i, d.m.y", strtotime($table['time'].'+2 hours'));

War bei mir nötig, weil mein Server 2h nach geht und ich logischerweiße keine Rechte zum ändern der Uhrzeit habe...
mono0 is offline  
Thanks
1 User
Old 04/08/2014, 01:18   #4
 
lnqlorlouz's Avatar
 
elite*gold: 0
Join Date: Jun 2013
Posts: 405
Received Thanks: 84
Danke euch beiden. Werde es heute Mittag mir mal anschauen und dann sagen, ob es klappt oder nicht.
lnqlorlouz is offline  
Old 04/08/2014, 11:18   #5
 
LatexLatte's Avatar
 
elite*gold: 27
Join Date: Apr 2014
Posts: 296
Received Thanks: 107
PHP Code:
<?php
date_default_timezone_set
('Europe/Berlin');
echo 
"<p>heutiges Datum: " date("d.m.Y");
?>
ganz simpel
LatexLatte is offline  
Reply


Similar Threads Similar Threads
Wie Timestamp fixxen ?
10/20/2011 - Metin2 Private Server - 0 Replies
Hey Ich habe mir eine Game Datei mit dem Tool von Kriege 4.1 erstellt (Kriege&Tim Version 4.1) nun möchte ich in dieser Game Datei das Timestamp fixxen weil sonst mein Server immer nach ca. 2h abschmiert ! Ich habe schon Tutorials gefunden aber die funktionierten auf meiner Gamfile leider nicht. Wiegesagt die Game Datei wurde mit dem Tool von Kriege 4.1 erstellt. Es wäre nett wenn einer einen Link zu nem HowTo senden würde oder vllt. das ganze über TV machen würde... Bei Interesse am...
Wie Timestamp fixxen ?
10/20/2011 - Metin2 Private Server - 0 Replies
Hey Ich habe mir eine Game Datei mit dem Tool von Kriege 4.1 erstellt (Kriege&Tim Version 4.1) nun möchte ich in dieser Game Datei das Timestamp fixxen weil sonst mein Server immer nach ca. 2h abschmiert ! Ich habe schon Tutorials gefunden aber die funktionierten auf meiner Gamfile leider nicht. Wiegesagt die Game Datei wurde mit dem Tool von Kriege 4.1 erstellt. Es wäre nett wenn einer einen Link zu nem HowTo senden würde oder vllt. das ganze über TV machen würde... Bei Interesse am...
Java Timestamp
10/09/2011 - Coding Tutorials - 1 Replies
public class Time { public static void main(String args) { System.out.println(new java.sql.Timestamp(System.currentTimeMillis())); } }
Unix
01/12/2011 - Off Topic - 5 Replies
Hallo, gibt es Unix als iso datei kostenlos legal zum downloaden ? Wenn ja könnt ihr bitte den link posten, habe nichts gute über google gefunden ;) dankeschön
jumpid?or txa(timestamp)?
10/23/2007 - Conquer Online 2 - 2 Replies
i asked this question in a different thread and got no answer......When you jump is there a jumpid(not the coords)as the 4-7 bytes or is it just txa(timestamp)?Someone has to know...if it is a jump_id how is that figured out?Also what bytes are the "to"coords and what bytes are the "from"cords?



All times are GMT +2. The time now is 21:31.


Powered by vBulletin®
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2024 elitepvpers All Rights Reserved.