English 中文(简体)
Pass Unix Timestamp to REST API Using Curl UnderWindows
原标题:Pass Unix Timestamp to REST API Using Curl Under Windows

我正在利用曲线与来自Windows指挥线的JeBrains YouTrack问题跟踪器的REST的A普切斯互动。 这是一种非常简单的过程,除盖尔外没有其他用途(作为单一窗口加以验证)。 我要简单地讲几句,但我已经提出一个问题。 一份内容提要文件希望我通过一个“灯光灯”,但是没有Windows的用途来制作。 我相信,只字不提一件事就够简单了,但我更喜欢不要再vent。

我在此呼吁的还有:

http://confluence.jetbrains.net/display/YTD3/PUT+Version

而且,我期待着把“再生”领域集中起来。

Is there a utility to generate the Unix timestamp on windows that is self contained, ie I don t need to install cygwin or something huge like that.

EDIT:关于此记录,我最后做些什么(部分档案):

type nul >pcmd.ps1
echo $timestamp=Get-Date -UFormat  %%s  >>pcmd.ps1
echo $timestamp=[Math]::Truncate($timestamp) >> pcmd.ps1
echo curl "http://myserver/rest/admin?releaseDate=$timestamp&isReleased=true" -v -b yt --upload-file empty >>pcmd.ps1

type pcmd.ps1

powershell - <pcmd.ps1
最佳回答
问题回答

日期:Now。 自01/01/0001年以来,Windows的“hundreds of nano seconds”数量就是如此。

Unix timestamp is the number of seconds since 01/01/1970.

You should be able to subtract to get the target timestamp.

DateTime dateTimeIWant = new DateTime(2011,05,01);
int targetUnixTimeStamp = (dateTimeIWant.Ticks - new DateTime(1970,1,1).Ticks) / 10000;




相关问题
Why running a service as Local System is bad on windows?

I am trying to find out the difference between difference service account types. I tumbled upon this question. The answer was because it has powerful access to local resources, and Network Service ...

Programmatically detect Windows cluster configuration?

Does anyone know how to programatically detect that a Windows server is part of a cluster? Further, is it possible to detect that the server is the active or passive node? [Edit] And detect it from ...

get file icon for Outlook appointment (.msg)

I ve read Get File Icon used by Shell and the other similar posts - and already use SHFileInfo to get the associated icon for any given extension, and that works great. However, Outlook uses ".msg" ...

Identifying idle state on a windows machine

I know about the GetLastInputInfo method but that would only give me the duration since last user input - keyboard or mouse. If a user input was last received 10 minutes ago, that wouldn t mean the ...

Terminating a thread gracefully not using TerminateThread()

My application creates a thread and that runs in the background all the time. I can only terminate the thread manually, not from within the thread callback function. At the moment I am using ...

热门标签