Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 10 of 33 for Date (0.15 sec)

  1. okhttp-tls/src/test/java/okhttp3/tls/internal/der/DerTest.kt

          .isEqualTo(date("1950-01-01T00:00:00.000+0000").time)
        assertThat(Adapters.parseUtcTime("500101010000Z"))
          .isEqualTo(date("1950-01-01T01:00:00.000+0000").time)
    
        assertThat(Adapters.parseUtcTime("491231225959Z"))
          .isEqualTo(date("2049-12-31T22:59:59.000+0000").time)
        assertThat(Adapters.parseUtcTime("491231235959Z"))
          .isEqualTo(date("2049-12-31T23:59:59.000+0000").time)
      }
    
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 31.7K bytes
    - Viewed (0)
  2. okhttp/src/main/kotlin/okhttp3/internal/http/DateFormatting.kt

        "EEE MMM d yyyy HH:mm:ss z",
      )
    
    private val BROWSER_COMPATIBLE_DATE_FORMATS =
      arrayOfNulls<DateFormat>(BROWSER_COMPATIBLE_DATE_FORMAT_STRINGS.size)
    
    /** Returns the date for this string, or null if the value couldn't be parsed. */
    fun String.toHttpDateOrNull(): Date? {
      if (isEmpty()) return null
    
      val position = ParsePosition(0)
      var result = STANDARD_DATE_FORMAT.get().parse(this, position)
      if (position.index == length) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 4.1K bytes
    - Viewed (0)
  3. okhttp/src/main/kotlin/okhttp3/Headers.kt

       * either the field is absent or cannot be parsed as a date.
       */
      fun getDate(name: String): Date? = get(name)?.toHttpDateOrNull()
    
      /**
       * Returns the last value corresponding to the specified field parsed as an HTTP date, or null if
       * either the field is absent or cannot be parsed as a date.
       */
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 11.5K bytes
    - Viewed (0)
  4. okhttp/src/test/java/okhttp3/CacheCorruptionTest.kt

      /**
       * @param delta the offset from the current date to use. Negative values yield dates in the past;
       *     positive values yield dates in the future.
       */
      private fun formatDate(
        delta: Long,
        timeUnit: TimeUnit,
      ): String? {
        return formatDate(Date(System.currentTimeMillis() + timeUnit.toMillis(delta)))
      }
    
      private fun formatDate(date: Date): String? {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Jan 20 10:30:28 GMT 2024
    - 6K bytes
    - Viewed (1)
  5. okhttp-tls/src/main/kotlin/okhttp3/tls/internal/der/Adapters.kt

            timeZone = utc
            set2DigitYearStart(Date(-631152000000L)) // 1950-01-01T00:00:00Z.
          }
    
        try {
          val parsed = dateFormat.parse(string)
          return parsed.time
        } catch (e: ParseException) {
          throw ProtocolException("Failed to parse UTCTime $string")
        }
      }
    
      internal fun formatUtcTime(date: Long): String {
        val utc = TimeZone.getTimeZone("GMT")
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 15K bytes
    - Viewed (0)
  6. okhttp/src/test/java/okhttp3/CookieTest.kt

      }
    
      @Test fun expiresDate() {
        assertThat(Date(parse(url, "a=b; Expires=Thu, 01 Jan 1970 00:00:00 GMT")!!.expiresAt))
          .isEqualTo(date("1970-01-01T00:00:00.000+0000"))
        assertThat(Date(parse(url, "a=b; Expires=Wed, 09 Jun 2021 10:18:14 GMT")!!.expiresAt))
          .isEqualTo(date("2021-06-09T10:18:14.000+0000"))
        assertThat(Date(parse(url, "a=b; Expires=Sun, 06 Nov 1994 08:49:37 GMT")!!.expiresAt))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 24.3K bytes
    - Viewed (0)
  7. okhttp/src/test/java/okhttp3/CookiesTest.kt

        assertThat(cookie.name).isEqualTo("a")
        assertThat(cookie.value).isEqualTo("android")
        assertThat(cookie.commentURL).isNull()
        assertThat(cookie.discard).isFalse()
        // Converting to a fixed date can cause rounding!
        assertThat(cookie.maxAge.toDouble()).isCloseTo(60.0, 5.0)
        assertThat(cookie.path).isEqualTo("/path")
        assertThat(cookie.secure).isTrue()
      }
    
      @Test
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 13K bytes
    - Viewed (0)
  8. okhttp/src/main/kotlin/okhttp3/Cookie.kt

              } else {
                Long.MAX_VALUE
              }
            expiresAt = currentTimeMillis + deltaMilliseconds
            if (expiresAt < currentTimeMillis || expiresAt > MAX_DATE) {
              expiresAt = MAX_DATE // Handle overflow & limit the date range.
            }
          }
    
          // If the domain is present, it must domain match. Otherwise we have a host-only cookie.
          val urlHost = url.host
          if (domain == null) {
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Sat Apr 06 04:12:05 GMT 2024
    - 23.1K bytes
    - Viewed (0)
  9. okhttp/src/test/java/okhttp3/HeadersJvmTest.kt

            .byteCount(),
        ).isEqualTo(20L)
      }
    
      @Test fun addDate() {
        val expected = Date(0L)
        val headers =
          Headers.Builder()
            .add("testDate", expected)
            .build()
        assertThat(headers["testDate"]).isEqualTo("Thu, 01 Jan 1970 00:00:00 GMT")
        assertThat(headers.getDate("testDate")).isEqualTo(Date(0L))
      }
    
      @Test fun addInstant() {
        val expected = Instant.ofEpochMilli(0L)
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Mon Jan 08 01:13:22 GMT 2024
    - 5.6K bytes
    - Viewed (0)
  10. okhttp/src/test/java/okhttp3/CacheTest.kt

      }
    
      /**
       * For Last-Modified and Date headers, we should echo the date back in the exact format we were
       * served.
       */
      @Test
      fun retainServedDateFormat() {
        // Serve a response with a non-standard date format that OkHttp supports.
        val lastModifiedDate = Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(-1))
        val servedDate = Date(System.currentTimeMillis() + TimeUnit.HOURS.toMillis(-2))
    Plain Text
    - Registered: Fri May 03 11:42:14 GMT 2024
    - Last Modified: Wed Apr 10 19:46:48 GMT 2024
    - 108.6K bytes
    - Viewed (0)
Back to top