# VBA_JSON Package
{: .no_toc }

**Author:** Tim Hall, published on TWINSERV by WaynePhillipsEA. **Version:** 2.3.1.1. **On GitHub:** [VBA-tools/VBA-JSON](https://github.com/VBA-tools/VBA-JSON) and [VBA-tools/VBA-UTC](https://github.com/VBA-tools/VBA-UTC), the VBA libraries the package is made from.

The **VBA_JSON** contributed package provides JSON parsing and serialization for VBA and twinBASIC projects, along with UTC and ISO 8601 date-conversion utilities. The package exposes a **JsonConverter** standard module containing the primary **ParseJson** and **ConvertToJson** functions, and a **Dictionary** class used to represent JSON objects in memory.

## Classes

- [Dictionary](/tB/Packages/Contributed/VBA_JSON/Dictionary/index.md) -- a string-keyed collection that maps String keys to Variant values, returned by ParseJson for JSON objects
  - [Item](/tB/Packages/Contributed/VBA_JSON/Dictionary/Item.md) -- returns or sets the value stored under a given key (default member)
  - [Keys](/tB/Packages/Contributed/VBA_JSON/Dictionary/Keys.md) -- returns all keys stored in the dictionary as a Variant array

## Modules

- [JsonConverter](/tB/Packages/Contributed/VBA_JSON/JsonConverter/index.md) -- provides JSON parsing, JSON serialization, and UTC/ISO 8601 date conversion
  - [ConvertToIso](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ConvertToIso.md) -- converts a local date to an ISO 8601 date-time string in UTC
  - [ConvertToJson](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ConvertToJson.md) -- converts a VBA value to its JSON string representation
  - [ConvertToUtc](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ConvertToUtc.md) -- converts a local date to the equivalent UTC date using the system time zone
  - [ParseIso](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ParseIso.md) -- parses an ISO 8601 date/time string and returns the equivalent local Date value
  - [ParseJson](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ParseJson.md) -- parses a JSON string and returns a Dictionary or Collection object
  - [ParseUtc](/tB/Packages/Contributed/VBA_JSON/JsonConverter/ParseUtc.md) -- converts a UTC date to the equivalent local date using the system time zone

## Test cases

The notes and warnings of this section are checked by the test cases in [VBA_JSON-tests.twinproj](VBA_JSON-tests.twinproj), a twinBASIC project. It uses VBA_JSON as a [linked package](/Features/Packages/Linked.md#manual-management): put the package's `.twinpack` in `%APPDATA%\twinBASIC\packages`, then run the project, and each case prints whether it passes.
