我正在使用asp.net mvc3。如何在服務器端獲取當前時間?
Scenario:
(PC1) as server side or where I publish my project
和(PC2) as client or where I am using my current PC
。在PC1
當前時間是10:00 AM
,PC2
是01:00 PM
具有相同或不同的日期。在我點擊按鈕之後,我有一個按鈕,用於獲取PC1
的時間(cshtml)
。
到目前爲止,我在控制器中嘗試了代碼DateTime.Now()
,但是它獲得了當前PC中的當前時間? Not sure about this one
。
如何解決這類問題?
將其轉換爲特定時區這是現在您第3次提問此問題! –