我需要墙上消息发布日期和时间. [英] I need wall message publish date and time.

查看:86
本文介绍了我需要墙上消息发布日期和时间.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在C#.net 3.5 Web项目上工作,想获取我自己帐户的收件箱消息和挂历消息以及日期和时间.
我能够提取收件箱消息和挂号消息,但未提供日期和时间.
我正在使用以下代码:-

string gettingPost = api.Fql.Query("SELECT message, created_time  FROM stream WHERE source_id =userId ");


该行返回所有墙消息,并返回created_time值=1279173603.
这是什么?我不明白.
如果有任何解决方案,请回复...

谢谢

解决方案

我想您正在为此使用一些API.最好将其发布在他们的讨论论坛 [
这看起来像一个数字时间值(以秒为单位).我认为您可以通过使用构造函数DateTime(Int64)并将其乘以10,000,000(TimeSpan.TicksPerSecond)并将其转换为C#DateTime(100纳秒刻度).
[edit]您还需要在年份中添加1969(请参见DateTime.AddYears()),因为上述时间值基于1970年1月1日,而DateTime结构基于0001年1月1日.[/edit]

Hi,

I am working on C#.net 3.5 web project and want to fetch an inbox message and wall message of my own account with date and time.
I am able to fetch an inbox message and wall message but it does not give date and time.
I am using following code:-

string gettingPost = api.Fql.Query("SELECT message, created_time  FROM stream WHERE source_id =userId ");


This line returns all the wall messages and it returns created_time value = 1279173603.
What is this? I do not understand.
Please reply...if there are any solutions.

Thanks

解决方案

I guess you are using some API for this. It would be better if you post it on their discussion forum[^].


"This line returns all the wall messages and it returns created_time value = 1279173603."

This looks like a numeric time value (in seconds). I think you can convert it to a C# DateTime (100 nanosecond ticks) by using the constructor DateTime(Int64) using the above value multiplied by 10,000,000 (TimeSpan.TicksPerSecond).

[edit]You will also need to add 1969 to the year (see DateTime.AddYears()) as the time value above is based on 1 January 1970 and the DateTime structure is based on 1 January 0001.[/edit]


这篇关于我需要墙上消息发布日期和时间.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆