Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 2 of 2 for formatUtcTime (0.29 sec)

  1. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

                return parseUtcTime(string)
              }
    
              override fun encode(
                writer: DerWriter,
                value: Long,
              ) {
                val string = formatUtcTime(value)
                return writer.writeUtf8(string)
              }
            },
        )
    
      internal fun parseUtcTime(string: String): Long {
        val utc = TimeZone.getTimeZone("GMT")
        val dateFormat =
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 15K bytes
    - Viewed (0)
  2. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

          .isEqualTo(date("2049-12-31T23:59:59.000+0000").time)
      }
    
      @Test fun `encode utc time two digit year cutoff is 1950`() {
        assertThat(Adapters.formatUtcTime(date("1950-01-01T00:00:00.000+0000").time))
          .isEqualTo("500101000000Z")
        assertThat(Adapters.formatUtcTime(date("2049-12-31T23:59:59.000+0000").time))
          .isEqualTo("491231235959Z")
      }
    
      @Test fun `parse generalized time`() {
    Registered: Fri Nov 01 11:42:11 UTC 2024
    - Last Modified: Mon Jan 08 01:13:22 UTC 2024
    - 31.7K bytes
    - Viewed (0)
Back to top