English version
Accueil     À propos     Téléchargement     Ressources     Contactez-nous    

Ce site est rarement mis à jour. Pour les informations les plus récentes, rendez-vous sur le nouveau site OCaml à l'adresse ocaml.org.

Browse thread
.-
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: 2004-12-24 (10:03)
From: Anastasia Gornostaeva <ermine@e...>
Subject: .-
Hello.

open Unix

let _ =
   let curr_time = time () in
   let curr_tm = gmtime curr_time in
   let new_time, _ = mktime {curr_tm with tm_hour = curr_tm.tm_hour+1} in
   let diff = new_time -. curr_time in
      Printf.printf "%f\n%f\n%f\n"
	 curr_time
	 new_time
	 diff


gives an negative result -7200.000000. Why?