---
title: "C#获取当前时间戳"
author: "ruohanfly"
date: "2016-01-27T09:48:55Z"
tags: []
categories: ["编程语言"]
slug: "c"
draft: false
lastmod: "2016-01-27T09:48:55Z"
id: 2274198
url: "https://ruohanfly.iteye.com/blog/2274198"
---

```
TimeSpan tss = DateTime.UtcNow - new DateTime(1970, 1, 1, 0, 0, 0, 0);
long a = Convert.ToInt64(tss.TotalMilliseconds);
```