go.mondoo.com/cnquery@v0.0.0-20231005093811-59568235f6ea/providers/os/resources/powershell/timestamp_test.go (about)

     1  // Copyright (c) Mondoo, Inc.
     2  // SPDX-License-Identifier: BUSL-1.1
     3  
     4  package powershell
     5  
     6  import (
     7  	"testing"
     8  	"time"
     9  
    10  	"github.com/stretchr/testify/assert"
    11  )
    12  
    13  func TestPSJsonTimestamp(t *testing.T) {
    14  
    15  	timestamp := PSJsonTimestamp("\\/Date(1599609600000)\\/")
    16  	assert.Equal(t, time.Unix(1599609600, 0).Unix(), timestamp.Unix())
    17  }