我想爲喬達時間創建一個種子點。我試圖實現的是,我將在Joda-Time中提供一個種子datetime
,這應該會生成兩個不同的隨機datetime
,使得在datetime2
之前,並且此datetime
將僅生成該種子點的特定小時的值。使用喬達時間種子,然後比較
例如
time- 18:00:00 followed by date-2013-02-13
Random1 - 2013-02-13 18:05:24
Random2 - 2013-02-13 18:48:22
從一個數據庫收到時間並且用戶選擇日期。我需要以指定格式隨機生成兩次 您可以看到只有分鐘和秒會改變,沒有別的會被修改。
這可能嗎?我怎樣才能做到這一點?
令人難以置信的工作,謝謝你通過減秒second獲得time2的想法從來沒有打到我的腦海。非常感謝你。 – chettyharish 2013-02-10 06:44:21
@chettyharish我的榮幸。 :)只需檢查角落案件的執行情況和錯誤。例如,隨機時間可能相同,特別是如果第一次是18:59:59。 – ZeroOne 2013-02-12 07:06:18