You can see the full text of these two code sections in the Welfare and Institutions Code. Neither provides for a 30 day hold but more importantly neither is considered a criminal arrest. See W&I Code § 5157. Caution: many people are put on these holds following an arrest for something else that will go on their records. If you were only detained for evaluation and nothing else it shouldn't be on your rap sheet.