Wie ändere ich die Zeit in Python?

8

Ich wollte die Minuten / Stunden pythonischer Zeit ändern. Ich habe eine Kette von Zeit start_time = "2013-09-30 14:12:08.024923" . Ich möchte es in seine Viertel-, Halb- oder Vollzeit konvertieren, dh wenn ich das Intervall als 15 einstelle, sollte ich 2013-09-30 14:15:00.0000 bekommen. Wenn das Intervall 30 ist, sollte ich 2013-09-30 14:15:00.0000

erhalten

Wie kann ich es ändern?

Hier ist was ich versucht habe.

%Vor%

Wie erreiche ich das?

    
PythonEnthusiast 01.10.2013, 04:45
quelle

1 Antwort

13

Sie können dies mit replace :

tun %Vor%     
David Robinson 01.10.2013, 04:54
quelle

Tags und Links

yii\base\ErrorException
Copied! Copy Stacktrace Search Stackoverflow Search Google Error

PHP Core Warningyii\base\ErrorException

PHP Startup: Unable to load dynamic library 'mongodb.so' (tried: /usr/lib64/php/modules/mongodb.so (/usr/lib64/php/modules/mongodb.so: cannot open shared object file: No such file or directory), /usr/lib64/php/modules/mongodb.so.so (/usr/lib64/php/modules/mongodb.so.so: cannot open shared object file: No such file or directory))

$_GET = [
    'id' => '355346',
    'url' => 'how-to-alter-the-time-in-python',
];

$_SESSION = [
    '__flash' => [],
];