Auto Json format, jsonbeautifier, Url, Timestamp en/decode online develop tools

hello, you can input a few type string that like json timestamp, url en/decode, will auto detect it and en/decode.

more function is building.


current timestamp: current datetime:

JSON Viewer / JSON Beautifier / JSON Decode Online

The JSON format is syntactically identical to the code for creating JavaScript objects. Because of this similarity, a JavaScript program can easily convert JSON data into native JavaScript objects. The JSON syntax is derived from JavaScript object notation syntax, but the JSON format is text only.

The free JSON Beautifier tool used as JSON editor, Json viewer, Json Validator, JSON Decode Online, valid json and Json formatter to parse json in a tree view and plain text, have jsonlink jsonpretty functions.

javascript json parse

var students = '{"id": 1, "name": "dan", "age": 20, "grade": {"gradeId": 1, "gradeName": "abc"}}';
console.log(typeof students);

var model = JSON.parse(students);
console.log(typeof model);
console.log(model);

python json dump

>>> import json
>>> json.dumps(['foo', {'bar': ('baz', None, 1.0, 2)}])
'["foo", {"bar": ["baz", null, 1.0, 2]}]'
>>> print(json.dumps("\"foo\bar"))
"\"foo\bar"
>>> print(json.dumps('\u1234'))
"\u1234"
>>> print(json.dumps('\\'))
"\\"
>>> print(json.dumps({"c": 0, "b": 0, "a": 0}, sort_keys=True))
{"a": 0, "b": 0, "c": 0}

// Pretty printing
>>> import json
>>> print(json.dumps({'4': 5, '6': 7}, sort_keys=True, indent=4))
{
    "4": 5,
    "6": 7
}

python json loads & python parse json

>>> import json
>>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
['foo', {'bar': ['baz', None, 1.0, 2]}]

python dict to json

import json

# Data to be written
dictionary ={
    "id": "04",
    "name": "sunil",
    "department": "HR"
}
    
# Serializing json
json_object = json.dumps(dictionary, indent = 4)
print(json_object)

java parse json

import org.json.*;

String jsonString = ... ; //assign your JSON String here
JSONObject obj = new JSONObject(jsonString);
String pageName = obj.getJSONObject("pageInfo").getString("pageName");

JSONArray arr = obj.getJSONArray("posts"); // notice that `"posts": [...]`
for (int i = 0; i < arr.length(); i++)
{
    String post_id = arr.getJSONObject(i).getString("post_id");
    ......
}

php json encode/decode

// php json encode
$aryStudent = [
    'id' => 1,
    'name' => 'dan',
];
$jsonStr = json_encode($aryStudent);
var_dump(jsonStr);

// php json decode to object
$jsonObj = json_decode($jsonStr);
var_dump($jsonObj);

// php json decode to array
$jsonAry = json_decode($jsonStr, true);
var_dump($jsonAry);

javascript object to json

// Stringify a JavaScript Object
const obj = {name: "John", age: 30, city: "New York"};
const myJSON = JSON.stringify(obj);
console.log(myJSON);

// Parsing JSON
const obj = JSON.parse('{"name":"John", "age":30, "city":"New York"}');
console.log(obj);

URL decode online / URL encode online

A free url encode online tools, url decode online tools.

The URL is the address of a web page, like: https://dev-tools.link, URL encoding converts characters into a format that can be transmitted over the Internet.

URL encoding stands for encoding certain characters in a URL by replacing them with one or more character triplets that consist of the percent character "%" followed by two hexadecimal digits. The two hexadecimal digits of the triplet(s) represent the numeric value of the replaced character.

Analyze the URL, Basic URI syntax:
scheme:[//[user:password@]host[:port]][/]path[?query][#fragment]

The first step into encoding a URI is examining its parts and then encoding only the relevant portions.

javascript url encode / javascript url decode

// javascript url encode

// encodes characters such as ?,=,/,&,:
console.log(encodeURIComponent('htts://dev-tools.link?test=1'));
// expected output: "htts%3A%2F%2Fdev-tools.link%3Ftest%3D1"

console.log(encodeURIComponent('htts://dev-tools.link?test=шеллы'));
// expected output: "htts%3A%2F%2Fdev-tools.link%3Ftest%3D%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"


// javascript url decode
const uri = 'htts://dev-tools.link/?x=шеллы';
const encoded = encodeURI(uri);
console.log(encoded);
// expected output: "htts://dev-tools.link/?x=%D1%88%D0%B5%D0%BB%D0%BB%D1%8B"

try {
  console.log(decodeURI(encoded));
  // expected output: "htts://dev-tools.link/?x=шеллы"
} catch (e) { // catches a malformed URI
  console.error(e);
}

php urlencode / php urldecode

// php urlencode() example
echo '<a href="mycgi?foo=', urlencode($userinput), '">';

// php urlencode() and htmlentities() example
$query_string = 'foo=' . urlencode($foo) . '&bar=' . urlencode($bar);
echo '<a href="mycgi?' . htmlentities($query_string) . '">';

python urlencode / python urldecode

// python url encode python3
>>> import urllib.parse
>>> query = 'Hellö Wö[email protected]'
>>> urllib.parse.quote(query)
'Hell%C3%B6%20W%C3%B6rld%40Python'

// python url encode python2
>>> import urllib
>>> urllib.quote('Hello [email protected]')
'Hello%20World%40Python2'

// python url decode python3
>>> import urllib.parse
>>> encodedStr = 'Hell%C3%B6%20W%C3%B6rld%40Python'
>>> urllib.parse.unquote(encodedStr)
'Hellö Wö[email protected]'

// python url decode python2
>>> import urllib
>>> queryStr = 'Hello%20World%0A'
>>> urllib.unquote(queryStr)
'Hello World\n'

java url encode / java url decode

// java url encode
private String encodeURL(String value) {
    return URLEncoder.encode(value, StandardCharsets.UTF_8.toString());
}

// java url decode
private String decodeURL(String value) {
    return URLDecoder.decode(value, StandardCharsets.UTF_8.toString());
}

A free timestamp to date Converter tools

The unix time stamp is a way to track time as a running total of seconds. This count starts at the Unix Epoch on January 1st, 1970 at UTC(Time Interval Since 1970).

Timestamp Online is timestamp converver between unix timestamp and human readable form date. If you want to convert timestamp, it is sufficient to either enter your timestamp into input area.

Get current timestamp in some programes

Get timestamp in swift

NSDate().timeIntervalSince1970

Get timestamp in Go lang

import ( "time")
int32(time.Now().Unix())

Get timestamp in Java

// in pure java
(int) (System.currentTimeMillis() / 1000)

// in joda
(int) (DateTime.now().getMillis() / 1000)

Get timestamp in JavaScript

	
Math.round(new Date() / 1000)

Get timestamp in Objective-C

[[NSDate date] timeIntervalSince1970]

Get timestamp in MySQL

    SELECT unix_timestamp(now())

Get timestamp in SQLite

SELECT strftime('%s', 'now')

Get timestamp in Erlang

calendar:datetime_to_gregorian_seconds(calendar:universal_time())-719528*24*3600.

Get timestamp in PHP

// pure php
time()

// Carbon\Carbon
Carbon::now()->timestamp

Get timestamp in Python

import time
time.time()

Get timestamp in Ruby

Time.now.to_i

Get timestamp in Shell

date +%s

Get timestamp in Groovy

(new Date().time / 1000).intValue()

Get timestamp in Lua

os.time()

Get timestamp in .NET/C#

(DateTime.Now.ToUniversalTime().Ticks - 621355968000000000) / 10000000