What is the equivalent to php's time() function in VB.NET?

2008-03-11 5:34 pm
Dim Unix_TS as Integer = ?

What command would I put in place of the question mark to find the current unix timestamp? Thanks!
更新1:

Wow that did not work, it created all sorts of errors. Do I need to import any libraries to use this function?

回答 (1)

2008-03-11 5:50 pm
✔ 最佳答案
Dim Unix_TS as String = DateAndTime.now.

You may need
Dim Unix_TS as String = Microsoft.VisualBasic.DateAndTime.Now

But try the first one first.

There are various other methods for getting this. They all are in the DateandTime object though. Just go through them. You can have it give you military, show AM/PM, just the date, just the time, etc.


收錄日期: 2021-04-30 23:04:40
原文連結 [永久失效]:
https://hk.answers.yahoo.com/question/index?qid=20080311093431AAZGNmB

檢視 Wayback Machine 備份